Skip to content

BUG: Fix scalar methods to receive keyword arguments#9527

Merged
eric-wieser merged 8 commits intonumpy:masterfrom
Licht-T:fix-scalar-astype
Aug 13, 2017
Merged

BUG: Fix scalar methods to receive keyword arguments#9527
eric-wieser merged 8 commits intonumpy:masterfrom
Licht-T:fix-scalar-astype

Conversation

@Licht-T
Copy link
Contributor

@Licht-T Licht-T commented Aug 7, 2017

This fixes #9512 .

@eric-wieser
Copy link
Member

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.

@Licht-T
Copy link
Contributor Author

Licht-T commented Aug 7, 2017

@eric-wieser Thanks for your reply.
Your opinion is right in terms of performance.
I have no idea for avoiding a performance hit.

@eric-wieser
Copy link
Member

Either way, this patch probably is good enough as is - just trying to start a discussion about future work

*
* #name = tolist, item, tostring, tobytes, astype, copy, __deepcopy__,
* #name = tolist, item, tostring, tobytes, copy, __deepcopy__,
* searchsorted, view, swapaxes, conj, conjugate, nonzero, flatten,
Copy link
Member

@eric-wieser eric-wieser Aug 8, 2017

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll fix.

@Licht-T
Copy link
Contributor Author

Licht-T commented Aug 10, 2017

@eric-wieser Fixed.
Should I change the PR title?

@eric-wieser eric-wieser changed the title BUG: Fix scalar-astype so that it can receive keyword arguments BUG: Fix scalar methods to receive keyword arguments Aug 10, 2017
@eric-wieser
Copy link
Member

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

@eric-wieser
Copy link
Member

Separate commits did make it super-easy to review though, so thanks!

@eric-wieser eric-wieser merged commit a13c066 into numpy:master Aug 13, 2017
eric-wieser added a commit to eric-wieser/numpy that referenced this pull request Oct 19, 2017
The np.generic.astype method now accepts these keyword arguments
charris added a commit that referenced this pull request Oct 19, 2017
theodoregoetz pushed a commit to theodoregoetz/numpy that referenced this pull request Oct 23, 2017
The np.generic.astype method now accepts these keyword arguments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scalar astype method doesn't accept keyword arguments

3 participants