class Foo(object): def __getattr__(self, item): print(item) return '__getattr__' obj = Foo() print(obj.method) # 输出: method __getattr__
'__getattr__'
obj.method