__getattribute__
class Foo:
def __init__(self,x):
self.x = x
def __getattribute__(self, item):
print('不管是否纯在,我都会执行')
f1 = Foo(10)
f1.x
f1.xxxxxxxxxxx
class Foo:
def __init__(self,x):
self.x = x
def __getattribute__(self, item):
print('不管是否纯在,我都会执行')
f1 = Foo(10)
f1.x
f1.xxxxxxxxxxx