decorators - more than just syntactic sugar

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Sat Aug 11 14:56:05 EDT 2007


On Sat, 11 Aug 2007 20:30:54 +0200, Helmut Jarausch wrote:

> are decorators more than just syntactic sugar in python 2.x and what
> about python 3k ?

They are just syntactic sugar.

@spam
def ham():
    pass

is the same as

def ham():
    pass

ham = spam(ham)

> How can I find out the predefined decorators?

*The* predefined decorators?  Decorators are just functions after all. 
There are some meant to be used as decorators but there are also
"ordinary" functions that may make sense as decorators.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list