Direct Attribute Access¶
The following methods can be defined to customize the meaning of attribute access (use of, assignment to, or deletion of x.name) for class instances.
Methods¶
- __getattribute__
- Called unconditionally to implement attribute accesses for instances of the class.
- __getattr__
- Called when an attribute lookup has not found the attribute in the usual places.
- __setattr__
- Called when an attribute assignment is attempted.
- __delattr__
- Called when an attribute deletion is attempted.