On 20 March 2018 at 16:25, Gregory P. Smith <g...@krypto.org> wrote:

> On Thu, Mar 15, 2018 at 3:26 AM Nick Coghlan <ncogh...@gmail.com> wrote:
>
>> If we did head in this direction, then we'd also need to accept &
>> implement PEP 499 [1] (which proposes aliasing __main__ as
>> __main__.__spec__.name in sys.modules when executed with "-m") to avoid
>> causing problems.
>>
>
> I don't doubt that doing this would require a lot of code cleanup. :)
>

I was recently reminded of a "fun" edge case for PEP 499: "python -m site",
which reruns a module that gets implicitly imported at startup (so "site"
is already in sys.modules by the time __main__ runs).

That said, the way that currently works (re-running sitecustomize and
usercustomize) isn't particularly wonderful, so proposing changing it would
be reasonable.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to