BUG: Remove builtins from __all__#14881
Merged
mattip merged 2 commits intonumpy:masterfrom Nov 12, 2019
Merged
Conversation
Previously this would fail, but only on python 3.7+ ``` np.new_member = 1 assert 'new_member' in dir(np) ``` While this isn't something we support anyway, it certainly wasn't intentional.
ddf88d1 to
88b79e3
Compare
Member
|
I wonder what downstream code this will break: if there are packages or users who depend on Edit: ahh, never mind. My comment is to a previous verison of the PR description, now it is not relevant |
Member
Author
|
Turns out this is actually a really recent regression, in 3ca0eb1 |
This was introduced in 3ca0eb1, due to an incorrect implementation of `__dir__` (fixed in the previous commit). It was never released, so this is not a breaking change. In that commit, `from numpy import *` would reset all the builtins to their defaults, and set `unicode = str`, `long = int`.
88b79e3 to
9ce99dd
Compare
Member
Author
|
Reclassified, retitled, and tagged for 1.18, with that new information. |
Member
|
LGTM. I will merge soon, pending other reviews |
Member
|
Thanks for catching this @eric-wieser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was introduced in 3ca0eb1, due to an incorrect implementation of
__dir__(fixed in the first commit of this patch). Looks like I never finished reviewing this part of the original PR.It was never released, so this is not a breaking change.
In that commit,
from numpy import *would reset all the builtins to their defaults, and setunicode = str,long = int.