Python Professional — Hard
Key points
- `__slots__` reduces memory usage by avoiding the creation of a `__dict__` per instance
- This feature is particularly useful when memory optimization is a priority
- `__slots__` does not make attributes read-only or enable multiple inheritance without MRO conflicts
Ready to go further?
Related questions
