-
-
Notifications
You must be signed in to change notification settings - Fork 11k
BUG: Add void field at end of dtype.descr to match itemsize #6361
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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 numpygh-6359
I would not say I know too much about these descriptors, but it seems right to add the void field at the end as well.... |
This sounds right to me, but maybe we should re-read the Array Interface docs and PEP-3118 to be sure. |
Yes, those docs suggest this is the right fix. Consider:
Note that typestr says there are 16 bytes, yet descr only describes 12 bytes. But in the Array Interface docs it says of So we do need to add the void at the end. |
Also |
I just added a duplicate of the test there. While the behaviour is identical, no pain in just duplicating to make sure this stays identical even if it might some day be ripped apart. |
LGTM. I will let this sit a few hours and then I'm happy to merge. Also, for future reference I noticed that there is a test Anyway, that can be left for a later fix. Both |
BUG: Add void field at end of dtype.descr to match itemsize
Merged. Thanks @seberg. |
This reverts commit a600a5c, reversing changes made to 77fb742. The expanded warning led to incompatibilities with with Numpy 1.9, which had already the future behavior for the cases covered by the extended warning conditions. Rather than roll back the behavior of 1.9 only to reimplement it later, it is thought better to preserve it and move on.
Revert "Merge pull request #6376 from charris/backport-gh-6361"
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