From 35c41afd61540c27af5004d480618b59355d02f8 Mon Sep 17 00:00:00 2001 From: Mark Harfouche Date: Fri, 27 Jan 2023 09:51:39 -0500 Subject: ENH: Add slots to NDArrayOperatorsMixin to make subclsasing smoother I use the mixings in a few different file backed arrays. However, the lack of slots make it difficult for me to use slots. I mostly use slots to ensure that performance optimized code doesn't create unecessary references to large chunks of memory. If all parent classes do not have `__slots__` defined, I think that Python (3.9) just ignores `__slots__` alltogether. Thank you for considering. --- numpy/lib/mixins.py | 1 + 1 file changed, 1 insertion(+) (limited to 'numpy/lib/mixins.py') diff --git a/numpy/lib/mixins.py b/numpy/lib/mixins.py index c81239f6b..117cc7851 100644 --- a/numpy/lib/mixins.py +++ b/numpy/lib/mixins.py @@ -133,6 +133,7 @@ class NDArrayOperatorsMixin: .. versionadded:: 1.13 """ + __slots__ = () # Like np.ndarray, this mixin class implements "Option 1" from the ufunc # overrides NEP. -- cgit v1.2.1