MiddleObject.py 文件源码

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

项目:w4py 作者: Cito 项目源码 文件源码
def updateReferencingListAttrs(self):
        """Update all referencing list attributes.

        Checks through all object references, and asks each referenced
        object to remove us from any list attributes that they might have.
        """
        for attr in self.klass().allAttrs():
            if isinstance(attr, ObjRefAttr):
                value = getattr(self, '_' + attr.name())
                if value is not None:
                    if isinstance(value, (MiddleObject, InstanceType)):
                        value.removeObjectFromListAttrs(self)
                    elif isinstance(value, long):
                        obj = self.store().objRefInMem(value)
                        if obj:
                            obj.removeObjectFromListAttrs(self)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号