[Python-Dev] What about PEP 299?

Charles Cazabon python at discworld.dyndns.org
Wed Mar 29 00:44:00 CEST 2006


Guido van Rossum <guido at python.org> wrote:
> On 3/28/06, Georg Brandl <g.brandl at gmx.net> wrote:
> > since I found myself writing "if __name__ == '__main__'"
> > often these days, I wondered whether PEP 299 could be pronounced
> > upon. I'm not proposing putting it into 2.5, but it should be
> > relatively small a change.
> 
> If you're asking for a quick pronouncement, it's going to be "no".
> It's not worth the change (in docs, user habits, etc.) and there's
> nothing particularly broken.

It might be worth instead adding an option flag to the executable that implies
"from the loaded module, run __main__() with sys.argv as its argument(s)", so
the user can get this behaviour with `python -X somemodule.py`.

Charles
-- 
-----------------------------------------------------------------------
Charles Cazabon                           <python at discworld.dyndns.org>
GPL'ed software available at:               http://pyropus.ca/software/
-----------------------------------------------------------------------


More information about the Python-Dev mailing list