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

Antoine Pitrou solipsis at pitrou.net
Mon Nov 25 23:14:22 CET 2013


On Mon, 25 Nov 2013 13:57:57 -0800
Guido van Rossum <guido at python.org> wrote:
> > I still don't think the current idiom is problematic, so I'm -0.8 on
> > the whole thing :-)
> 
> Check the length of this thread. (And the ones before it. :-)

Well, the #1 complaint seems be that it's not terribly pretty. That
doesn't sound like a huge problem to me :-) Am I missing something?

(I also understand that it relies on a more-or-less implementation
detail, but the implementation detail will have to stay for
compatibility reasons, anyway)

Regards

Antoine.




More information about the Python-ideas mailing list