[Python-Dev] Decorator syntax (original) (raw)
Xavier Morel xavier.morel at masklinn.net
Wed Sep 2 12:50:33 CEST 2009
- Previous message: [Python-Dev] Decorator syntax
- Next message: [Python-Dev] Decorator syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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'
- Previous message: [Python-Dev] Decorator syntax
- Next message: [Python-Dev] Decorator syntax
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]