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

Guido van Rossum guido at python.org
Mon Nov 25 23:50:51 CET 2013


On Mon, Nov 25, 2013 at 2:39 PM, Barry Warsaw <barry at python.org> wrote:

> On Nov 25, 2013, at 02:29 PM, Guido van Rossum wrote:
>
> >For all I care you can call it ismain().
>
> Okay, I think I'm going to officially not care now.  :)   None of these
> suggestions seem worth the effort to indoctrinate folks to some new idiom,
> regardless of how it's spelled.
>

I mostly agree -- but if people insist on a better idiom, a builtin
function is the only one I can live with. I don't particularly care what
that builtin function is called, as long as it is not a __dunder__ name.
And it must be a function.

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131125/0bed4a06/attachment.html>


More information about the Python-ideas mailing list