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
">

(original) (raw)

On Mon, Jun 18, 2012 at 7:17 PM, Ethan Furman <ethan@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())