Skip to content

support for __slots__ #10517

@jbrelwof

Description

@jbrelwof

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions