diff options
author | Matti Picus <matti.picus@gmail.com> | 2020-01-21 11:28:58 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-21 11:28:58 +1100 |
commit | f71d9937d1e8a1e709f325f689f1e971e64c26a7 (patch) | |
tree | 1f8b26a1bb346fab26d2210de286d29011bf2bf1 /numpy/lib/mixins.py | |
parent | b753aa7a3a2c958e70826fb8af3b56db5c758819 (diff) | |
parent | 9a21ec857b22ff0140a7f71a12f2cc943f163404 (diff) | |
download | numpy-f71d9937d1e8a1e709f325f689f1e971e64c26a7.tar.gz |
Merge pull request #15335 from sethtroisi/sys_version_easy
MAINT: Remove sys.version checks
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( |