The special attribute __slots__ allows you to explicitly state which instance attributes you expect your object instances to have, with the expected results:
- faster attribute access.
- space savings in memory.
The space savings is from
- Storing value references in slots instead of
__dict__. - Denying
__dict__and__weakref__creation if parent classes deny them and you declare__slots__.