-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
BUG: Revert multifield-indexing adds padding bytes for NumPy 1.15. #10411
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,18 @@ npy_cache_import(const char *module, const char *attr, PyObject **cache) | |
} | ||
} | ||
|
||
NPY_INLINE static PyObject * | ||
npy_import(const char *module, const char *attr) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was this function added? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh... I thought it was used in I'll make a followup to remove this. |
||
{ | ||
PyObject *mod = PyImport_ImportModule(module); | ||
PyObject *ret = NULL; | ||
|
||
if (mod != NULL) { | ||
ret = PyObject_GetAttrString(mod, attr); | ||
} | ||
Py_XDECREF(mod); | ||
|
||
return ret; | ||
} | ||
|
||
#endif |
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.
Why are we using C-style comments again? If we have a good reason, it seems our tests ought to be catching this...
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.
Yes, no test catches this. But it is in the style guide.
We did release 1.13 with these comments present and no-one complained, so maybe it is harmless. We fixed them in the 1.14 branch though.
Also, a grep shows that there is only one other place in numpy with a C++ comment, in
common.c
, which was also added by me in 2016. If we want to remove all C++ comments, I could fix that one into this PR too.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.
We do it because there used to be compilers that didn't accept the C++ style comments. We can probably drop this when we go to c99, although mixed comment styles can be a bit annoying. We should probably test for that,
-ansi
might detect that, although it could give us other errors. IIRC, it didn't work (many years ago).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.
Right, although given that no-one complained in 1.13 it seems no-one building numpy uses incompatible compilers any more.
In any case, I just made the change in
common.c
in this PR, so now numpy is totally free of C++ comments.