inhahe a écrit :
Both the responses offer lambda free alternatives. That's fine, and
given the terse documentation and problems that I had understanding
them, I would agree. So what applications are lambdas suited to? I
think the parameterised function model is one.
What else?
i've hardly ever used lambdas since map() and filter() were replaced by list
comprehension. two other uses I can think of for it are: using it as a
sorting key (which takes a function and lambdas are perfect for that when a
direct function isn't available. for example, lambda x: x.myName),
import operator
foos.sort(key=operator.attrgetter('myName'))
--
http://mail.python.org/mailman/listinfo/python-list