<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 20 March 2018 at 16:25, Gregory P. Smith <span dir="ltr"><<a href="mailto:greg@krypto.org" target="_blank">greg@krypto.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><span class=""><div dir="ltr">On Thu, Mar 15, 2018 at 3:26 AM Nick Coghlan <<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>> wrote:</div></span><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra">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.</div></div></blockquote><div><br></div></span><div>I don't doubt that doing this would require a lot of code cleanup. :)</div></div></div></blockquote><div><br></div><div>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).<br><br></div><div>That said, the way that currently works (re-running sitecustomize and usercustomize) isn't particularly wonderful, so proposing changing it would be reasonable.<br></div><div><br></div><div>Cheers,<br></div><div>Nick.<br clear="all"></div></div><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Nick Coghlan   |   <a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>   |   Brisbane, Australia</div>
</div></div>