Python Professional — Hard
Key points
- Child classes without __slots__ inherit a __dict__ from parent classes
- Memory savings of __slots__ are not preserved in child instances without __slots__
- Defining __slots__ in child classes is necessary to maintain memory efficiency
Ready to go further?
Related questions
