core.py 文件源码

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

项目:SanicMongo 作者: beepaste 项目源码 文件源码
def __getattr__(self, name):
        if name.startswith('_'):
            # Here first I try to get the _attribute from
            # from the delegate obj.
            try:
                ret = getattr(self.delegate, name)
            except AttributeError:
                raise AttributeError(
                    "%s has no attribute %r. To access the %s"
                    " collection, use collection['%s']." % (
                        self.__class__.__name__, name, name,
                        name))
            return ret

        return self[name]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号