[issue36375] PEP 499 implementation: "python -m foo" binds the main module as both __main__ and foo in sys.modules

Cameron Simpson report at bugs.python.org
Mon Nov 25 22:59:28 EST 2019


Cameron Simpson <cs at cskk.id.au> added the comment:

On 25Nov2019 17:38, Python Bug Reports <report at bugs.python.org> wrote:
>Eric Snow <ericsnowcurrently at gmail.com> added the comment:
>
>FWIW, I have some feedback on the PEP.  (See msg357448.)  Can we discuss here or should I open a mailing list thread?

Let's discuss it here unless it looks like we need wider input. This is 
related to issue37292 (_xxsubinterpreters: Can't unpickle objects 
defined in __main__), yes?

With PEP499, "python -m foo" should have __name__=='__main__' and 
__spec__.name=='foo'. Were you thinking the __module__ should come from 
__spec__.name (and that the PEP should make that clear)?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36375>
_______________________________________


More information about the Python-bugs-list mailing list