property 的 AttributeError 的传播问题

前言去年我写过一篇 你用对 hasattr 了嘛? 介绍过被 property 装饰的方法内部抛错会引起 hasattr 的结果为 False。今天又遇到了一个 AttributeError 向上传播的问题 (Python 2),一起来看看问题先上代码:In : class T(object):...: @property...: def name(self):...: print(self.missing_attribute)...: return 42...: def __getattr__(self, name):...: ……