[Python-ideas] Just main (original) (raw)

Yuval Greenfield ubershmekel at gmail.com
Mon Jun 18 18:49:41 CEST 2012


On Mon, Jun 18, 2012 at 7:17 PM, Ethan Furman <ethan at stoneleaf.us> wrote:

anatoly techtonik wrote:

How about global main as a boolean?

name == 'main' as a mark of entrypoint module is coherent and logical, but awkward to type and requires explicit explaination for newcomers even with prior background in other langauges. So instead of: if name == 'main': ... you would have: if main: ... ? Ethan +1

Makes sense....

if main: sys.exit(main())

http://www.artima.com/weblogs/viewpost.jsp?thread=4829 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120618/92b88abe/attachment.html>



More information about the Python-ideas mailing list