forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Milestone
Description
CircuitPython does not use __slots__ within class definitions. Support for __slots__ could result in potentially significant runtime and memory savings, especially for classes with lots of instances (because no __dict__ per instance is needed).
Some of the benefits of __slots__ overlap with collections.namedTuple, but namedTuple instances are immutable. However, I suspect even a naive/limited __slots__ support implementation would probably be more complex than namedTuple.