-
-
Notifications
You must be signed in to change notification settings - Fork 12.3k
ENH: Add __slots__ = () to NDArrayOperatorsMixin #22876
Copy link
Copy link
Closed
Description
Proposed new feature or change:
Currently, if any parent class in an inheritance chain does not define __slots__, then all subclasses allow dynamic attribute creation. Even if every subsequent subclass defines __slots__, attributes are still able to be added to instances.
It would be really nice if the NDArrayOperatorsMixin class defined __slots__ = (). This would allow subclasses to prevent dynamic attribute creation by also using __slots__. I don't think there is a downside to adding this and the upside is that subclasses could then choose to add slots of their own and prevent dynamic attribute creation.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels