-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
BUG: Fix scalar methods to receive keyword arguments #9527
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
LGTM, although I wonder if there are others with this problem, and we should just use the kwargs path for all of them - which at worst is a (small) performance hit. |
@eric-wieser Thanks for your reply. |
Either way, this patch probably is good enough as is - just trying to start a discussion about future work |
@@ -1529,7 +1529,7 @@ gentype_wraparray(PyObject *NPY_UNUSED(scalar), PyObject *args) | |||
*/ | |||
/**begin repeat | |||
* | |||
* #name = tolist, item, tostring, tobytes, astype, copy, __deepcopy__, | |||
* #name = tolist, item, tostring, tobytes, copy, __deepcopy__, | |||
* searchsorted, view, swapaxes, conj, conjugate, nonzero, flatten, |
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.
From looking at methods.c
, these also don't belong here:
tostring
tobytes
copy
searchsorted
view
flatten
ravel
Many of these take order=
arguments
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.
Okay, I'll fix.
@eric-wieser Fixed. |
Wow, you didn't need to do each of those in a separate commit - that's just making work for yourself! We can change PR titles easily from the web interface anyway, so don't worry about it - it's commit messages that are more work to change, but yours are fine already |
Separate commits did make it super-easy to review though, so thanks! |
The np.generic.astype method now accepts these keyword arguments
MAINT: Remove workarounds for gh-9527
The np.generic.astype method now accepts these keyword arguments
This fixes #9512 .