A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2009-September/091556.html below:

[Python-Dev] Decorator syntax

[Python-Dev] Decorator syntax [Python-Dev] Decorator syntaxXavier Morel xavier.morel at masklinn.net
Wed Sep 2 12:50:33 CEST 2009
On 2 Sep 2009, at 12:15 , Rob Cliffe wrote:
>
> @Identity(DecoList[0])    # THIS WORKS
> def foo():
>    pass
For what it's worth, you don't need an id function, you can simply write

     @itemgetter(0)(decorators)
     def foo():
         'whatever'
or

     @decorators.__getitem__(0)
     def foo():
         'whatever'

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4