alias.py 文件源码

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

项目:pyomo 作者: Pyomo 项目源码 文件源码
def __setattr__(self, name, attr):
        # avoid infinite recursion
        if name in Alias.__slots__:
            # this is how you access a slot while bypassing __setattr__
            return Alias.__dict__[name].__set__(self, attr)

        if name in Alias._component_slots:
            super(Alias, self).__dict__[name] = attr
            return

        if self.aliased_object is None:
            raise weakref.ReferenceError("Proxy is not longer valid")
        return setattr(self.aliased_object, name, attr)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号