recipe-576523.py 文件源码

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

项目:code 作者: ActiveState 项目源码 文件源码
def reach(self, ids):
            """
            \param ids Iterable of object id, as returned by x[0],
            with x in the result of (snapshot2 - snapshot1)

            Return a dict id -> object with that id currently known.

            The objects recorded with these id might have been
            replaced by new ones... so we might end-up seeing objects
            that don't correspond to the original ones. This is
            especially true after a gc.collect()
            """
            result = dict()
            for obj in gc.get_objects():
                if id(obj) in ids:
                    result[id(obj)] = obj
            return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号