On 9/11/2015 3:56 AM, Herbert Kruitbosch wrote:

I was wondering if there are considerations for including partial
function application syntactically. I very often find myself writing
statements as:
data_sorted = sort(data, key = lambda x: x[0])
where I would prefer
data_sorted = sort(data, key = #1[0])
where the #1 is similar to the one used in Mathematica for the same
purpose. That is, an expression with #1 becomes an anonymous function
which takes one argument, and, obviously, if a #n is included, the
anonymous function takes n arguments.

For future reference, ideas like this belong on the python-list or
python-ideas list. Pydev is more for discussion of policy, concrete
issues for the next releases, and approval ideas that have been fully
fleshed out in the form of a PEP.

Terry Jan Reedy

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 4 of 4 | next ›
Discussion Overview
grouppython-dev @
postedSep 11, '15 at 7:56a
activeSep 11, '15 at 10:13p



site design / logo © 2018 Grokbase