Slots for all of .rest classes
Pre-release
Pre-release
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__
.