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

Eric Snow report at bugs.python.org
Tue Nov 26 10:32:01 EST 2019


Eric Snow <ericsnowcurrently at gmail.com> added the comment:

Exactly. :)

I'd expect PEP 499 to specify changing __module__ of classes and functions from __main__ to the module name (__spec__.name).  This aligns closely with the whole point of the PEP. :)  As a bonus, it will simplify things for pickling (which doesn't inherently deal well with __main__).

----------

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


More information about the Python-bugs-list mailing list