From 74b68e37a478ca5d6e515196af1108e9494a01f1 Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Wed, 27 Sep 2006 22:46:11 +0000 Subject: Add quotes to printing strings. --- numpy/core/arrayprint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'numpy/core/arrayprint.py') diff --git a/numpy/core/arrayprint.py b/numpy/core/arrayprint.py index e33e5a969..50ae4fb26 100644 --- a/numpy/core/arrayprint.py +++ b/numpy/core/arrayprint.py @@ -169,7 +169,8 @@ def _array2string(a, max_line_width, precision, suppress_small, separator=' ', data.imag, precision, suppress_small, sign=1) format_function = lambda x: \ _formatComplex(x, real_format, imag_format) - elif issubclass(dtype, _nt.unicode_): + elif issubclass(dtype, _nt.unicode_) or \ + issubclass(dtype, _nt.string_): format = "%s" format_function = lambda x: repr(x) else: -- cgit v1.2.1