summaryrefslogtreecommitdiff
path: root/numpy/lib/mixins.py
diff options
context:
space:
mode:
authorMark Harfouche <mark.harfouche@gmail.com>2023-01-27 09:51:39 -0500
committerMark Harfouche <mark.harfouche@gmail.com>2023-01-27 09:51:39 -0500
commit35c41afd61540c27af5004d480618b59355d02f8 (patch)
tree41728c1afcd0bda93a3d913c3f4a01b6dd0a4123 /numpy/lib/mixins.py
parent3c3a6b5157d4d36172f59cda2fc9e2badf5dfbe5 (diff)
downloadnumpy-35c41afd61540c27af5004d480618b59355d02f8.tar.gz
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.
Diffstat (limited to 'numpy/lib/mixins.py')
-rw-r--r--numpy/lib/mixins.py1
1 files changed, 1 insertions, 0 deletions
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.