recipe-546530.py 文件源码

python
阅读 40 收藏 0 点赞 0 评论 0

项目:code 作者: ActiveState 项目源码 文件源码
def named_refs(obj, **opts):
    """Returns (a generator for) all named *referents* of an object
    (re-using functionality from **asizeof**).

    See function **basicsize** for a description of the options.

    Does not return un-named *referents*, e.g. objects in a list.
    """
    t = _typedefof(obj, **opts)
    if t:
        r = t.refs
        if r and _iscallable(r):
            for nr in r(obj, True):
                try:
                    yield nr.name, nr.ref
                except AttributeError:
                    pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号