8000 MAINT, DOC: Remove use of old Python __builtin__, now known as builtins by mwtoews · Pull Request #15418 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

MAINT, DOC: Remove use of old Python __builtin__, now known as builtins #15418

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
Jan 24, 2020

Conversation

mwtoews
Copy link
Contributor
@mwtoews mwtoews commented Jan 24, 2020

Python 2's __builtin__ module is replaced with the builtins module.

A few notes:

  • See gh-6103 for planned DEP to numpy/__init__.py, which are not touched here, just re-arranged to remove Python 2 logic
  • Not sure if "See also" link in numpy/core/defchararray.py will work in Sphinx outputs (the current __builtin__.len does not link)
  • Removed a 14-year-old "hmm," comment (44f0e40) that does not make sense for the current form of numpy/distutils/misc_util.py.

@mwtoews mwtoews changed the title MAINT/DOC: Remove use of old Python __builtin__, now known as builtins MAINT, DOC: Remove use of old Python __builtin__, now known as builtins Jan 24, 2020
else:
from __builtin__ import bool, int, float, complex, object, unicode, str
from builtins import bool, int, float, complex, object, str
unicode = str
Copy link
Member

Choose a reason for hiding this comment

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

unicode is also defined in np.compat. We may want to deal with that at some point. It is unfortunate that it is part of the default numpy api.

@charris charris merged commit b5fa352 into numpy:master Jan 24, 2020
@charris
Copy link
Member
charris commented Jan 24, 2020

Thanks @mwtoews .

@mwtoews mwtoews deleted the builtin branch March 9, 2021 10:31
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
0