[Python-Dev] Let's just keep lambda (original) (raw)

Steven Bethard steven.bethard at gmail.com
Mon Feb 6 05:44:15 CET 2006


Guido van Rossum wrote:

After so many attempts to come up with an alternative for lambda, perhaps we should admit defeat. I've not had the time to follow the most recent rounds, but I propose that we keep lambda, so as to stop wasting everybody's talent and time on an impossible quest.

Personally, I'd rather see a callable-from-expression syntax (the lambda expression) that looks more like our callable-from-statements syntax (the def statement), e.g. Nick Coghlan's def-from syntax::

(def f(a) + o(b) - o(c) from (a, b, c))

Something like this is more consistent with how list creation is turned into list comprehensions, how generator functions are turned into generator expressions and how if/else statements are turned into conditional expressions.

That said, I firmly believe that syntax decisions must be left to the BDFL. The decorator syntax and with-statement syntax debates clearly showed this. So if after looking at all the syntax alternatives_, you feel that the current lambda syntax is the best we can do, I'm willing to accept that decision.

.. _alternatives: http://wiki.python.org/moin/AlternateLambdaSyntax

STeVe

Grammar am for people who can't think for myself. --- Bucky Katt, Get Fuzzy



More information about the Python-Dev mailing list