-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
bpo-36375: PEP499: implementation and documentation and test updates #12455
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
Conversation
@@ -0,0 +1,8 @@ | |||
PEP 499 implemented: the "python -m module_name" command line option now binds the imported module | |||
to both ``sys.modules['__main__'`` and additionally to ``sys.modules['module_name']``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sys.modules['__main__']
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, fix applied, thank you! - Cameron
which led to hard to debug issues where the object resolved by ``__main__.obj_name`` | ||
was distinct from the object resolved by ``module_name.obj_name``. | ||
This led to subtle breakage of code which relied on objtect identity tests, | ||
particularly ``isinstance`` tests and ``try/except`` clauses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will write isisntance()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, applied. Thanks! - Cameron
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the travis error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please review the Travis errors
Hmm. They look related to a problem with hashlib, and not obviously my patch. Would it be sensible for me to rebase the PR on the latest master to trigger a retry? New to this process. |
…nd sys.modules[foo]
a555e63
to
47a666d
Compare
Trying it: rebase, see if the travis results change. If not I'll try to reproduce locally. |
Well, no change. And it isn't just hashlib. Investigating further now... |
Ok... Investigating cleaner ways to do this. Plan A is to |
I'm withdrawing this PR, I've clearly not run the full test suite. I'll bring it back when the tests pass. |
@cameron-simpson Ouch. You'll also need to be careful regarding the interactions with the |
(Superseded, see #12490 instead)
This PR provides an implementation of the -m option semantics change from PEP 499. It also provides some documentation updates and 2 unit tests.
https://bugs.python.org/issue36375