summaryrefslogtreecommitdiff
path: root/numpy/numarray
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2013-04-11 14:31:52 -0600
committerCharles Harris <charlesr.harris@gmail.com>2013-04-13 07:43:56 -0600
commit7f5af37e26ba2e99ad3ee6928b78437f601e96e0 (patch)
tree1b210bb7361ce691e781884bf06f89c7ebd13360 /numpy/numarray
parent74b08b3f0284d9d2dd55a15dd98a3846913b1b51 (diff)
downloadnumpy-7f5af37e26ba2e99ad3ee6928b78437f601e96e0.tar.gz
2to3: Apply the `numliterals` fixer and skip the `long` fixer.
The numliterals fixer replaces the old style octal number like '01' by '0o1' removes the 'L' suffix. Octal values were previously mistakenly specified in some dates, those uses have been corrected by removing the leading zeros. Simply Removing the 'L' suffix should not be a problem, but in some testing code it looks neccesary, so in those places the Python long constructor is used instead. The 'long' type is no longer defined in Python 3. Because we need to have it defined for Python 2 it is added to numpy/compat/np3k.py where it is defined as 'int' for Python 3 and 'long' for Python 2. The `long` fixer then needs to be skipped so that it doesn't undo the good work. Closes #3074, #3067.
Diffstat (limited to 'numpy/numarray')
-rw-r--r--numpy/numarray/functions.py4
-rw-r--r--numpy/numarray/numerictypes.py3
2 files changed, 4 insertions, 3 deletions
diff --git a/numpy/numarray/functions.py b/numpy/numarray/functions.py
index 9b72a27e2..3f91046d2 100644
--- a/numpy/numarray/functions.py
+++ b/numpy/numarray/functions.py
@@ -31,14 +31,14 @@ import sys
import math
import operator
+import numpy as np
from numpy import dot as matrixmultiply, dot, vdot, ravel, concatenate, all,\
allclose, any, argsort, array_equal, array_equiv,\
array_str, array_repr, CLIP, RAISE, WRAP, clip, concatenate, \
diagonal, e, pi, inner as innerproduct, nonzero, \
outer as outerproduct, kron as kroneckerproduct, lexsort, putmask, rank, \
resize, searchsorted, shape, size, sort, swapaxes, trace, transpose
-import numpy as np
-
+from numpy.compat import long
from .numerictypes import typefrom
if sys.version_info[0] >= 3:
diff --git a/numpy/numarray/numerictypes.py b/numpy/numarray/numerictypes.py
index caf40cf45..21685c34d 100644
--- a/numpy/numarray/numerictypes.py
+++ b/numpy/numarray/numerictypes.py
@@ -29,6 +29,8 @@ $Id: numerictypes.py,v 1.55 2005/12/01 16:22:03 jaytmiller Exp $
"""
from __future__ import division, absolute_import, print_function
+import numpy
+from numpy.compat import long
__all__ = ['NumericType','HasUInt64','typeDict','IsType',
'BooleanType', 'SignedType', 'UnsignedType', 'IntegralType',
@@ -45,7 +47,6 @@ __all__ = ['NumericType','HasUInt64','typeDict','IsType',
MAX_ALIGN = 8
MAX_INT_SIZE = 8
-import numpy
LP64 = numpy.intp(0).itemsize == 8
HasUInt64 = 1