Is there any syntax for using a decorator on a lambda function in Python? Example:
def simpledecorator(f):
def new_f():
print "Using a decorator: "
f()
return new_f
@simpledecorator
def hello():
print "Hello world!"
>>> hello()
Using a simple decorator:
Hello world!
@anotherdecorator
f = lambda x: x * 2
File "<stdin", line 2
f = lambda x: x * 2
^
SyntaxError: invalid syntax