Rhodri James wrote:
On Fri, 13 Mar 2009 14:49:17 -0000, Beni Cherniavsky
<beni.cherniav...@gmail.com> wrote:
...Allow keyword arguments in function call to take this form:
NAME ( ARGUMENTS ) = EXPRESSION
which is equivallent to the following:
NAME = lambda ARGUMENTS: EXPRESSION
except that NAME is also assigned as the function's `__name__`.
My first instinct on seeing the example was that "key(n)" was a function
*call*, not a function definition, and to remember the thread a month or
two ago about assigning to the result of a function call. I'm inclined
to think this would add confusion rather than remove it.
The original proposal was initially appealing to me until I saw this
comment. That means a relatively "invisible typo" would turn into good
syntax. Possibley this is exactly what Rhodri James is talking about,
but just to be explicit, one of these is probably a mistake:
somefun(something, key(x)==5)
somefun(something, key(x)=5)
Right now a syntax error makes you look there, after your extension,
only test cases will show these problems.
--Scott David Daniels
scott.dani...@acm.org
--
http://mail.python.org/mailman/listinfo/python-list