Batista, Facundo wrote:
[Nick Coghlan]

#- I just don't understand why people complain so much about
#- the restriction to a
#- single expression in lambdas, yet there is nary a peep about
#- the same
#- restriction for generator expressions and list comprehensions.

What *I* don't understand (and it could perfectly be plain ignorance, as never studied languages or computer sciences) is why anonymous functions are so important.

Speaking for myself, I find lazy evaluation of arguments is impractical without them. Defining 2 or 3 named functions in order to make a single function call seems rather unnecessarily verbose. I don't need to use lazy evaluation very often, but when I do use it, it is generally because other approaches would be much more complicated (or significantly less efficient).


This usage pattern is also why I do not find the restriction to a single expression a problem in practice - since I'm merely delaying the evaluation of what I would have supplied as a function argument anyway, I'm already working with an expression.

Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to