[Python-ideas] making a module callable

Haoyi Li haoyi.sg at gmail.com
Fri Nov 22 22:06:50 CET 2013


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

+100.


On Fri, Nov 22, 2013 at 1:02 PM, Philipp A. <flying-sheep at web.de> wrote:

> 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
>>
>>
>
> _______________________________________________
> 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/0a0a46f0/attachment-0001.html>


More information about the Python-ideas mailing list