Roman Suzi wrote:
I wish lambdas will not be deprecated in Python but the key to that is
dropping the keyword (lambda). If anybody could think of a better syntax for
lambdas _with_ arguments, we could develop PEP 312 further.

Well, my vote is still with Ruby-style codeblock syntax, but as a compromise, what about the following:


  fun(a, b): a + b

as a replacement for:

  lambda a, b: a + b

Advantages:
  - Doesn't use the l-word
  - Uses parentheses always
  - "fun" is shorter and self-describing
  - Makes Python code more "fun" ;)

Disadvantages:
  - Requires a new keyword, breaking backward compatibility
    (I'm assuming we're still talking about Py3k here)
  - (Still) doesn't interface statements with expressions

Dave
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to