[Python-ideas] Allow lambda decorators

Oleg Broytmann phd at phd.pp.ru
Mon Feb 9 18:12:28 CET 2009


On Mon, Feb 09, 2009 at 09:09:18AM -0800, Guido van Rossum wrote:
> [(lambda x, _i=i: x+i) for i in range(10)]

   Either

[(lambda x, i=i: x+i) for i in range(10)]

   or

[(lambda x, _i=i: x+_i) for i in range(10)]

   :-)

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.



More information about the Python-ideas mailing list