On Thu, 21 Apr 2005, Guido van Rossum wrote:
> The use cases where the block actually returns a value are probably
> callbacks for things like sort() or map(); I have to admit that I'd
> rather keep lambda for these (and use named functions for longer
> blocks) than introduce an anonymous block syntax that can return
> values!
It seems to me that, in general, Python likes to use keywords for
statements and operators for expressions.
Maybe the reason lambda looks like such a wart is that it uses a
keyword in the middle of an expression. It also uses the colon
*not* to introduce an indented suite, which is a strange thing to
the Pythonic eye. This suggests that an operator might fit better.
A possible operator for lambda might be ->.
sort(items, key=x -> x.lower())
Anyway, just a thought.
-- ?!ng
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com