[Python-ideas] making a module callable

Philipp A. flying-sheep at web.de
Fri Nov 22 22:02:56 CET 2013


we’re all accustomed to it, but objectively, it’s horribly implicit and
unobvious.

i’d be all for a decorator:

#@mainfunction? or just @main? maybe @entrypoint?
@mainfunctiondef main(args):
    assert args == sys.argv[1:]



2013/11/22 Gregory P. Smith <greg at krypto.org>

> It'd be nice to formalize a way to get rid of the __name__ == '__main__'
> idiom as well in the long long run. Sure everyone's editor types that for
> them now but it's still a wart.  Anyways, digressing... ;)
>
> --
> blame half the typos on my phone.
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131122/9db71dc7/attachment.html>


More information about the Python-ideas mailing list