Thanks to visit codestin.com
Credit goes to github.com

Skip to content

MAINT/DOC: Use builtin when np.{x} is builtins.{x}. #9517

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

Merged
merged 1 commit into from
Aug 5, 2017

Conversation

charris
Copy link
Member

@charris charris commented Aug 5, 2017

Rebase of #9508.

This is the case for x in {int, bool, str, float, complex, object}. Using the np.{x} version is deceptive as it suggests that there is a difference. This change doesn't affect any external behavour. The long type is missing in python 3, so np.long is still useful. Likewise with np.unicode.

It may be difficult to deprecate these (#6103), but there's no reason we should be using them within our own code, or within our documentation.

Simple find and replace of np.(int|complex|object|str|bool|float)\b with $1.

This is the case for x in {int, bool, str, float, complex, object}.
Using the np.{x} version is deceptive as it suggests that there is a
difference. This change doesn't affect any external behaviour. The
`long` type is missing in python 3, so np.long is still useful
@eric-wieser
Copy link
Member

You could have force-pushed over the previous PR I think, but whatever. I'm guessing this is you approving of that changeset?

@eric-wieser
Copy link
Member

np.unicode is left alone for the same reason as np.long

@charris
Copy link
Member Author

charris commented Aug 5, 2017

Yes, I'll merge when the tests complete.

@charris
Copy link
Member Author

charris commented Aug 5, 2017

You could have force-pushed over the previous PR

I usually download and apply the patch, git am, rather than checkout the branch.

@eric-wieser
Copy link
Member

Seems I missed the .pyx files here

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.

2 participants