summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorTravis Oliphant <oliphant@enthought.com>2006-02-24 05:59:37 +0000
committerTravis Oliphant <oliphant@enthought.com>2006-02-24 05:59:37 +0000
commit71597d77b8713c58410e7377632eb1836d39f0f6 (patch)
treec3a0d0ad414e7fbefc8a9cc3056befb7d9b99ad0 /numpy/core/numeric.py
parente9b5c6347d998195f458fab52462f0f7c0931921 (diff)
downloadnumpy-71597d77b8713c58410e7377632eb1836d39f0f6.tar.gz
Change formating of all flexible arrays to str(arr.dtype)
Diffstat (limited to 'numpy/core/numeric.py')
-rw-r--r--numpy/core/numeric.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index cc1b0b1de..1da30e68f 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -236,15 +236,11 @@ def array_repr(arr, max_line_width=None, precision=None, suppress_small=None):
return cName + "(%s)" % lst
else:
typename=arr.dtype.type.__name__[:-6]
+ lf = ''
if issubclass(arr.dtype.type, flexible):
- if typename not in ['unicode','string','void']:
- typename = arr.dtype.type.__name__
- if typename == 'unicode':
- size = arr.itemsize >> 2
- else:
- size = arr.itemsize;
- typename = "(%s,%d)" % (typename, size)
- return cName + "(%s, dtype=%s)" % (lst, typename)
+ typename = str(arr.dtype)
+ lf = '\n'+' '*len("array(")
+ return cName + "(%s, %sdtype=%s)" % (lst, lf, typename)
def array_str(a, max_line_width=None, precision=None, suppress_small=None):
return array2string(a, max_line_width, precision, suppress_small, ' ', "", str)