When an attribute of a class is invoked, e.g. my_obj.attr
, __getattribute__
is first called. If that attribute exists, a value is returned. If that value does not exist, then __getattr__
is called instead.
References
https://mathspp.com/blog/til/difference-between-__getattr__-and-__getattribute__