Answer
__slots__ restricts dynamic attribute creation.
Saves memory by preventing per-instance __dict__.
Useful for memory-sensitive applications or many small objects.
Saves memory by preventing per-instance __dict__.
Useful for memory-sensitive applications or many small objects.