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

Philipp A. flying-sheep at web.de
Sun Nov 24 17:46:23 CET 2013


2013/11/24 Chris Angelico <rosuav at gmail.com>

The decorator minorly worries me; what happens if you use it on two
> functions? Presumably both would have to be called, in the order
> they're in the file (or rather, the order the decorators are called),
> but it'd be extremely confusing to try to read that code.
>
> ChrisA
>
people can also do more than one if __name__ == '__main__' blocks ATM…
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131124/edd142b5/attachment.html>


More information about the Python-ideas mailing list