Beni Cherniavsky beni.cherniav...@gmail.com wrote:
This proposal outrageously suggests a special syntax for in-line
functions passed as keyword arguments::
sorted(range(9), key(n)=n%3)
[0, 3, 6, 1, 4, 7, 2, 5, 8]
The claim is that such specialization hits a syntax sweet
On Mar 14, 5:30 pm, Nick Craig-Wood n...@craig-wood.com wrote:
BeniCherniavskybeni.cherniav...@gmail.com wrote:
This proposal outrageously suggests a special syntax for in-line
functions passed as keyword arguments::
sorted(range(9), key(n)=n%3)
[0, 3, 6, 1, 4, 7, 2, 5, 8]
On Fri, 13 Mar 2009 16:39:16 -, Scott David Daniels
scott.dani...@acm.org wrote:
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
On Fri, 13 Mar 2009 15:33:26 -, MRAB goo...@mrabarnett.plus.com
wrote:
Rhodri James wrote:
On Fri, 13 Mar 2009 14:49:17 -, Beni Cherniavsky
beni.cherniav...@gmail.com wrote:
Specification
=
Allow keyword arguments in function call to take this form:
NAME (
This proposal (a) ignores Guido's clear-cut decision that lambda is
good as it is, (b) is weird in proposing a special-case syntax, (c) is
several Python versions too late for a graceful transition by 3.0.
But I don't won't to just throw the idea away, so I'm posting here.
If there is serious
On Fri, 13 Mar 2009 14:49:17 -, Beni Cherniavsky
beni.cherniav...@gmail.com wrote:
Specification
=
Allow keyword arguments in function call to take this form:
NAME ( ARGUMENTS ) = EXPRESSION
which is equivallent to the following:
NAME = lambda ARGUMENTS:
Rhodri James wrote:
On Fri, 13 Mar 2009 14:49:17 -, Beni Cherniavsky
beni.cherniav...@gmail.com wrote:
Specification
=
Allow keyword arguments in function call to take this form:
NAME ( ARGUMENTS ) = EXPRESSION
which is equivallent to the following:
NAME = lambda
Rhodri James wrote:
On Fri, 13 Mar 2009 14:49:17 -, 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
MRAB goo...@mrabarnett.plus.com writes:
sorted(range(9), def key(n): n % 3)
[0, 3, 6, 1, 4, 7, 2, 5, 8]
Given the recent pattern of syntactic constructs for expressions using
expr keyword expr (ternary if, listcomps, genexps), and avoiding
the use of colon in expressions, maybe it should be:
Hrvoje Niksic wrote:
MRAB goo...@mrabarnett.plus.com writes:
sorted(range(9), def key(n): n % 3)
[0, 3, 6, 1, 4, 7, 2, 5, 8]
Given the recent pattern of syntactic constructs for expressions using
expr keyword expr (ternary if, listcomps, genexps), and avoiding
the use of colon in
MRAB:
sorted(range(9), def key(n): n % 3)
I am fine with the current lambda syntax, but another possibility:
sorted(range(9), n = n % 3)
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
11 matches
Mail list logo