On Fri, 13 Mar 2009 15:33:26 -, MRAB
wrote:
Rhodri James wrote:
On Fri, 13 Mar 2009 14:49:17 -, Beni Cherniavsky
wrote:
Specification
=
Allow keyword arguments in function call to take this form:
NAME ( ARGUMENTS ) = EXPRESSION
which is equivallent to the foll
On Fri, 13 Mar 2009 16:39:16 -, Scott David Daniels
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 about,
but just to be exp
On Mar 14, 5:30 pm, Nick Craig-Wood wrote:
> BeniCherniavsky 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 spec
Beni Cherniavsky 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 spot, and
> that thi
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
Hrvoje Niksic wrote:
MRAB 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
(ternary if, listcomps, genexps), and avoiding
the use of colon in expressions, maybe it should be:
sorted(range(9), k
MRAB 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
(ternary if, listcomps, genexps), and avoiding
the use of colon in expressions, maybe it should be:
sorted(range(9), key=n % 3 def key(n)
Rhodri James wrote:
On Fri, 13 Mar 2009 14:49:17 -, Beni Cherniavsky
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
Rhodri James wrote:
On Fri, 13 Mar 2009 14:49:17 -, Beni Cherniavsky
wrote:
Specification
=
Allow keyword arguments in function call to take this form:
NAME ( ARGUMENTS ) = EXPRESSION
which is equivallent to the following:
NAME = lambda ARGUMENTS: EXPRESSION
exce
On Fri, 13 Mar 2009 14:49:17 -, Beni Cherniavsky
wrote:
Specification
=
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
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 posit
11 matches
Mail list logo