diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-04-06 10:02:23 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-04-06 10:29:12 -0600 |
commit | 77e09f14bdf9eeebbd20ca861cb51da3e570bb72 (patch) | |
tree | b0c49fa552ccad7d2e9a384db72b79f5a758ba83 /numpy/lib | |
parent | 7441fa50523f5b4a16c854bf004d675e5bd86ab8 (diff) | |
download | numpy-77e09f14bdf9eeebbd20ca861cb51da3e570bb72.tar.gz |
MAINT: Cleanup some imports involving reduce.
Because reduce has been available in functools since Python 2.6 we
can get rid of the version checks we currently have before we import
it.
Also removes some reduce related skips in tools/py3tool.py. We were
already skipping the reduce fixer so this has no effect other than
cleaning up the code.
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/arrayterator.py | 3 | ||||
-rw-r--r-- | numpy/lib/tests/test_arrayterator.py | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/numpy/lib/arrayterator.py b/numpy/lib/arrayterator.py index b71e9a123..360d61bc5 100644 --- a/numpy/lib/arrayterator.py +++ b/numpy/lib/arrayterator.py @@ -14,8 +14,7 @@ from operator import mul __all__ = ['Arrayterator'] import sys -if sys.version_info[0] >= 3: - from functools import reduce +from functools import reduce class Arrayterator(object): """ diff --git a/numpy/lib/tests/test_arrayterator.py b/numpy/lib/tests/test_arrayterator.py index 28feb4824..3fa15fef1 100644 --- a/numpy/lib/tests/test_arrayterator.py +++ b/numpy/lib/tests/test_arrayterator.py @@ -1,15 +1,13 @@ from __future__ import division, absolute_import from operator import mul +from functools import reduce import numpy as np from numpy.random import randint from numpy.lib import Arrayterator from numpy.testing import assert_ -import sys -if sys.version_info[0] >= 3: - from functools import reduce def test(): np.random.seed(np.arange(10)) |