On Sun, Nov 24, 2013 at 7:08 PM, INADA Naoki <songofacandy@gmail.com> wrote:
I want to have callable main function to allow script can be executed directly or from other function.

def main():
    <blah>

if is_main():
    main()

is not shorter than

@mainfunction
def main():
    <blah>

But I like:

def __main__():
    <blah>

I had a few other arguments also against the decorator. (Like less magic. :-)

--
--Guido van Rossum (python.org/~guido)