summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorAlok Singhal <alok@merfinllc.com>2011-07-28 09:54:00 -0700
committerAlok Singhal <alok@merfinllc.com>2011-07-28 09:54:00 -0700
commit16e79053e5a4b85f636739b8ca242e90ace2c0b8 (patch)
tree6053af05296539617af28b2d2f0ef933a8115aa6 /numpy
parentd5b29c40c3d207a9ff5338560ec2fec8af28109e (diff)
downloadnumpy-16e79053e5a4b85f636739b8ca242e90ace2c0b8.tar.gz
BUG: don't use quotes in "dtype=name" when printing arrays for "simple" dtypes'
See: http://mail.scipy.org/pipermail/numpy-discussion/2011-July/057797.html
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/numeric.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index 80db6573e..f74b2548c 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -1333,7 +1333,11 @@ def array_repr(arr, max_line_width=None, precision=None, suppress_small=None):
if typeless and arr.size:
return cName + "(%s)" % lst
else:
- typename="'%s'" % arr.dtype.name
+ typename = arr.dtype.name
+ # Quote typename in the output if it is "complex".
+ if typename and not (typename[0].isalpha() and typename.isalnum()):
+ typename = "'%s'" % typename
+
lf = ''
if issubclass(arr.dtype.type, flexible):
if arr.dtype.names: