compat.py 文件源码

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

项目:python-flask-security 作者: weinbergdavid 项目源码 文件源码
def __getattr__(self, attr):
        proxy = self.__proxy
        if proxy and hasattr(proxy, attr):
            return getattr(proxy, attr)
        attrmap = self.__attrmap
        if attr in attrmap:
            source = attrmap[attr]
            if callable(source):
                value = source()
            else:
                value = _import_object(source)
            setattr(self, attr, value)
            self.__log.debug("loaded lazy attr %r: %r", attr, value)
            return value
        raise AttributeError("'module' object has no attribute '%s'" % (attr,))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号