[Python-ideas] Proposal for function expressions
Mike Meyer
mwm-keyword-python.b4bdba at mired.org
Wed Jul 15 06:01:30 CEST 2009
On Tue, 14 Jul 2009 23:50:29 -0400
George Sakkis <george.sakkis at gmail.com> wrote:
> Seconded, there's too much going on ('&', what's "do", a function ?,
> what's "item" ?, etc.). FWIW the only readable suggestion for
> multiline lambdas with almost zero learning curve I have seen is the
> one implemented in Boo, anonymous def and regular indentation:
>
> y = sorted(x, key=def (item):
> name = item.split('-')[1]
> return name.upper()
> )
>
> There must be somewhere posted the reason this was rejected but my
> google-fu is failing me.
It gets ugly when carried to - well, extremes is the word I want to
use, but is wanting two or three functional arguments inlined really
"extreme"? Likewise, what happens if you want to inline a functional
argument in an already inlined function?
The current proposal seems to avoid that - by limiting the number of
function parameters to 1, which is a pretty serious shortcoming.
Pretty much all such proposals fail on one of these two issues.
<mike
--
Mike Meyer <mwm at mired.org> http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
More information about the Python-ideas
mailing list