summaryrefslogtreecommitdiff
path: root/numpy/lib/recfunctions.py
diff options
context:
space:
mode:
authorAntony Lee <anntzer.lee@gmail.com>2021-09-29 20:09:32 +0200
committerGitHub <noreply@github.com>2021-09-29 13:09:32 -0500
commita6f7d14e60e3d56fe1c0073730a06e23cf696c5a (patch)
tree4f836f1bb7532f7b9265f9d07a868a61c4e79bbe /numpy/lib/recfunctions.py
parente7f5d62f793379a62d1c351eedaa3a59f6f542d5 (diff)
downloadnumpy-a6f7d14e60e3d56fe1c0073730a06e23cf696c5a.tar.gz
ENH: Add spaces after punctuation in dtype repr/str. (#19686)
Before: ``` In [1]: np.dtype({"names": ["a"], "formats": [int], "offsets": [2]}) Out[1]: dtype({'names':['a'], 'formats':['<i8'], 'offsets':[2], 'itemsize':10}) ``` After: ``` In [1]: np.dtype({"names": ["a"], "formats": [int], "offsets": [2]}) Out[1]: dtype({'names': ['a'], 'formats': ['<i8'], 'offsets': [2], 'itemsize': 10}) ``` * Allow switching back to old dtype printing format. * Add changelog.
Diffstat (limited to 'numpy/lib/recfunctions.py')
-rw-r--r--numpy/lib/recfunctions.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/lib/recfunctions.py b/numpy/lib/recfunctions.py
index fbfbca73d..a491f612e 100644
--- a/numpy/lib/recfunctions.py
+++ b/numpy/lib/recfunctions.py
@@ -819,7 +819,8 @@ def repack_fields(a, align=False, recurse=False):
...
>>> dt = np.dtype('u1, <i8, <f8', align=True)
>>> dt
- dtype({'names':['f0','f1','f2'], 'formats':['u1','<i8','<f8'], 'offsets':[0,8,16], 'itemsize':24}, align=True)
+ dtype({'names': ['f0', 'f1', 'f2'], 'formats': ['u1', '<i8', '<f8'], \
+'offsets': [0, 8, 16], 'itemsize': 24}, align=True)
>>> print_offsets(dt)
offsets: [0, 8, 16]
itemsize: 24