diff options
Diffstat (limited to 'numpy/lib/mixins.py')
-rw-r--r-- | numpy/lib/mixins.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/numpy/lib/mixins.py b/numpy/lib/mixins.py index d4811b94d..50157069c 100644 --- a/numpy/lib/mixins.py +++ b/numpy/lib/mixins.py @@ -1,6 +1,4 @@ """Mixin classes for custom array types that don't inherit from ndarray.""" -import sys - from numpy.core import umath as um @@ -152,9 +150,7 @@ class NDArrayOperatorsMixin: __mul__, __rmul__, __imul__ = _numeric_methods(um.multiply, 'mul') __matmul__, __rmatmul__, __imatmul__ = _numeric_methods( um.matmul, 'matmul') - if sys.version_info.major < 3: - # Python 3 uses only __truediv__ and __floordiv__ - __div__, __rdiv__, __idiv__ = _numeric_methods(um.divide, 'div') + # Python 3 does not use __div__, __rdiv__, or __idiv__ __truediv__, __rtruediv__, __itruediv__ = _numeric_methods( um.true_divide, 'truediv') __floordiv__, __rfloordiv__, __ifloordiv__ = _numeric_methods( |