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

Stephen J. Turnbull stephen at xemacs.org
Tue Nov 26 02:45:33 CET 2013


Paul Moore writes:

 > And to be honest, I suspect many of the "old hands" will simply
 > ignore the new idiom and continue using (and teaching others, by
 > example if nothing else) the old one - so it's not even as if the
 > old idiom is going to disappear.

Yup.

In my XEmacs init, I have a Python-specific "script" skeleton that
produces it (including a call to "main()" and other boilerplate)
automatically, and if python-dev doesn't break it, I won't fix it.



More information about the Python-ideas mailing list