summaryrefslogtreecommitdiff
path: root/numpy/core/_internal.py
diff options
context:
space:
mode:
authorSebastian Berg <sebastian@sipsolutions.net>2015-09-25 17:41:51 +0200
committerSebastian Berg <sebastian@sipsolutions.net>2015-09-25 17:42:52 +0200
commit8863ee9a24e866f79653f57154d431246a0e9079 (patch)
treed2284bdcf7ba24fad29119d4d31e0cd89d832e96 /numpy/core/_internal.py
parent7001d613aaa445ff650a273ec3d4db6787daf2e3 (diff)
downloadnumpy-8863ee9a24e866f79653f57154d431246a0e9079.tar.gz
BUG: Add void field at end of dtype.descr to match itemsize
dtype.descr returns void fields to explain the padding part of the dtype. The last void field for the itemsize itself was however not included. Closes gh-6359
Diffstat (limited to 'numpy/core/_internal.py')
-rw-r--r--numpy/core/_internal.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/core/_internal.py b/numpy/core/_internal.py
index 879f4a224..81f5be4ad 100644
--- a/numpy/core/_internal.py
+++ b/numpy/core/_internal.py
@@ -121,6 +121,10 @@ def _array_descr(descriptor):
offset += field[0].itemsize
result.append(tup)
+ if descriptor.itemsize > offset:
+ num = descriptor.itemsize - offset
+ result.append(('', '|V%d' % num))
+
return result
# Build a new array from the information in a pickle.