Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make range(...) + [None] work in python3

note that though this works in python2 also, it involves a pointless
copy; this is just in test code though, so it's probably fine.
  • Loading branch information...
commit ae6791e65acc957de1083b2c459949ae4d0d22e4 1 parent 750dff9
@dougalsutherland dougalsutherland authored
View
2  bottleneck/tests/fast_test.py
@@ -18,7 +18,7 @@ def arrayaxis(dtypes=bn.dtypes):
if not issubclass(a.dtype.type, np.inexact):
for shape in shapes:
a = a.reshape(shape)
- for axis in range(-a.ndim, a.ndim) + [None]:
+ for axis in list(range(-a.ndim, a.ndim)) + [None]:
yield a.copy(), axis
def fast_checker(selector, mode='func'):
View
2  bottleneck/tests/func_test.py
@@ -50,7 +50,7 @@ def unit_maker(func, func0, decimal=np.inf, nans=True):
msg = '\nfunc %s | input %s (%s) | shape %s | axis %s\n'
msg += '\nInput array:\n%s\n'
for i, arr in enumerate(arrays(nans=nans)):
- for axis in range(-arr.ndim, arr.ndim) + [None]:
+ for axis in list(range(-arr.ndim, arr.ndim)) + [None]:
with np.errstate(invalid='ignore'):
actual = 'Crashed'
desired = 'Crashed'
View
2  bottleneck/tests/input_modifcation_test.py
@@ -37,7 +37,7 @@ def unit_maker(func, nans=True):
msg = "\nInput array modifed by %s.\n\n"
msg += "input array before:\n%s\nafter:\n%s\n"
for i, arr in enumerate(arrays(nans=nans)):
- for axis in range(-arr.ndim, arr.ndim) + [None]:
+ for axis in list(range(-arr.ndim, arr.ndim)) + [None]:
with np.errstate(invalid='ignore'):
arr1 = arr.copy()
arr2 = arr.copy()
View
2  bottleneck/tests/partsort_test.py
@@ -36,7 +36,7 @@ def unit_maker(func, func0):
msg = '\nfunc %s | input %s (%s) | shape %s | n %d | axis %s\n'
msg += '\nInput array:\n%s\n'
for i, arr in enumerate(arrays()):
- for axis in range(-arr.ndim, arr.ndim) + [None]:
+ for axis in list(range(-arr.ndim, arr.ndim)) + [None]:
if axis is None:
n = arr.size
else:
Please sign in to comment.
Something went wrong with that request. Please try again.