summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2018-09-11 22:03:21 -0700
committerEric Wieser <wieser.eric@gmail.com>2018-09-11 22:53:19 -0700
commit16a029e37941a211f28f3910159e6ae85a0a5b8b (patch)
tree1c98dfbc996016e8ac38e3c50a83399ae8607c06
parent5cba7ca56aa83ce222b40dbfbb12f696d1a4ab75 (diff)
downloadnumpy-16a029e37941a211f28f3910159e6ae85a0a5b8b.tar.gz
MAINT: Extract a helper function for the dtype __str__ on scalar/simple types
-rw-r--r--numpy/core/_dtype.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/core/_dtype.py b/numpy/core/_dtype.py
index 7c79c6f5a..5047e194a 100644
--- a/numpy/core/_dtype.py
+++ b/numpy/core/_dtype.py
@@ -73,8 +73,11 @@ def _construction_repr(dtype, include_align=False, short=False):
return _struct_str(dtype, include_align=include_align)
elif dtype.subdtype:
return _subarray_str(dtype)
+ else:
+ return _scalar_str(dtype, short=short)
+def _scalar_str(dtype, short):
byteorder = _byte_order_str(dtype)
if dtype.type == np.bool_: