Terry Reedy a écrit :
Robert Dailey wrote:
I'm using Python 2.6. And using the legacy syntax in the lambda does
not work either. I want to avoid using a def if possible. Thanks.
In Python, writing
name = lambda arg: expr
instead of
def name(arg): return expr
is all negative and no positive and should be avoided.
Except that def is a statement, and as such can't be used as a named
params when calling a function expecting a callback, ie:
vroom = some_dead('parrot', name=lambda arg: exp)
(notice the 'name = lambda arg: exp' ?-)
Ok, nitpicking. Me --->[]
<g>
--
http://mail.python.org/mailman/listinfo/python-list