[Python-ideas] Replacing the if __name__ == "__main__" idiom (was Re: making a module callable)

Skip Montanaro skip at pobox.com
Tue Nov 26 04:45:17 CET 2013


> I still don't think the current idiom is problematic, so I'm -0.8 on
> the whole thing :-)

I'm with Antoine. I don't find it particularly onerous to type (how often
do you start a new program/script from scratch anyway?), and if it was a
big enough barrier, I'd capture the keystrokes in an Emacs macro (including
skeletal main and usage functions, and corresponding imports of sys and os
modules). I trust vim users could do something similar.

Skip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131125/2475526c/attachment.html>


More information about the Python-ideas mailing list