-
-
Notifications
You must be signed in to change notification settings - Fork 12k
BUG: Fix arr.flat.index for large arrays and big-endian machines
#19276
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
The type read when exposing was previously int, but has to be intp. this would only be visible for >2**31 elements, but is also visible on big-endian machines. Closes numpygh-19153
| #if NPY_SIZEOF_INTP <= NPY_SIZEOF_LONG | ||
| return PyLong_FromLong((long) self->size); | ||
| #else | ||
| if (self->size < NPY_MAX_LONG) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These must just leftovers from Python 2
|
Actually, this also needs to be used in at least all of |
mhvk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That seems all good! But what exactly went wrong on bigendian?
|
The |
|
Failure unrelated (see #19285) |
|
Thanks @seberg |
|
Thank you, all! |
To do that, I have a first commit to introduce a new
PyArray_PyIntFromIntpinline function, just because those#ifdef's everywhere are not very nice IMO.Closes gh-19153