Skip to content

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

Merged
charris merged 1 commit into
numpy:masterfrom
charris:rebase-9508
Aug 5, 2017
Merged

charris merged 1 commit into
numpy:masterfrom
charris:rebase-9508

Conversation

@charris

@charris charris commented Aug 5, 2017 •

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Member

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

@charris

charris commented Aug 5, 2017

Copy link
Copy Markdown
Member Author

Yes, I'll merge when the tests complete.

@charris

charris commented Aug 5, 2017

Copy link
Copy Markdown
Member Author

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
Copy Markdown
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