6. Metaclasses and Attributes¶
- 6.1. Use Plain Attributes Instead of Setter and Getter Methods
- 6.2. Consider @property Instead of Refactoring Attributes
- 6.3. Use Descriptors for Reusable @property Methods
- 6.4. Use __getattr__, __getattribute__, and __setattr__ for Lazy Attributes
- 6.5. Validate Subclasses with __init_subclass__
- 6.6. Register Class Existence with __init_subclass__
- 6.7. Annotate Class Attributes with __set_name__
- 6.8. Prefer Class Decorators Over Metaclasses for Composable Class Extensions