[Python-Dev] Let's just *keep* lambda

Michael Urman murman at gmail.com
Tue Feb 7 16:47:46 CET 2006

On 2/6/06, Brett Cannon <brett at python.org> wrote:
> And I think that a deferred object would help with one of
> lambda's biggest uses and made its loss totally reasonable.

The ambiguity inherent from the perspective of a deferred object makes
a general one impractical. Both map(Deferred().attribute, seq) and
map(Deferred().method(arg), seq) look the same - how does the object
know that the first case it should return the attribute of the first
element of seq when called, but in the second it should wait for the
next call when it will call method(arg) on the first element of seq?

Since there's also no way to spell "lambda y: foo(x, y, z)" on a
simple deferred object, it's strictly less powerful. If the current
Python lambda's functionality is desired, there is no better pythonic
way to spell it. There are plenty of new syntactic options that help
highlight its expression nature, but are they worth the change?

Michael Urman  http://www.tortall.net/mu/blog/

More information about the Python-Dev mailing list