Dynamic Attributes and Properties - MateuszMazurkiewicz/coding-and-learning GitHub Wiki
- Interpreter calls
__getattr__
and__setr__
to evaluate atribute access using dot notation (e.g.obj.attr
). A user-defined class implementing__getattr__
can implement "virtual attributes" by computing values on the fly whenever somebody tries to read nonexistent attribute.