[Python-ideas] Allow lambda decorators

Lie Ryan lie.1296 at gmail.com
Mon Feb 9 14:12:53 CET 2009


On Mon, 09 Feb 2009 12:44:20 +0000, Lie Ryan wrote:


> @lambdafunc
> def func(foo): pass
> 
> is equal to
> 
> def func(foo): pass
> func = lambdafunc(func)
> 
> why don't you do this instead:
> 
> lambdafunc(lambda foo: -foo)
> 
> it is perfectly readable and is a more functional approach than
> decorator.

OK, disregard that. I've just realized you want something really 
different.




More information about the Python-ideas mailing list