A
Size: a a a
A
A
СК
py3
class Test:
some_member = 'string literal'
def __getattr__(self, attr):
print("Tried to receive attribute:", attr)
return attr
instance = Test()
print("When attribute does not existspython will call method __getattr__:", instance.hui)
Tried to receive attribute: hui
When attribute does not existspython will call method __getattr__: hui
A
A
Б
К
A
A
СК
__getattribute__
который вызывается всегда, а есть __getattr__
который вызывается когда аттрибут не существуетК
A
СК
К
A
P
__getattribute__
который вызывается всегда, а есть __getattr__
который вызывается когда аттрибут не существуетСК
__setattr__
и __setattribute__
СК
К
СК