<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><blockquote type="cite"><div dir="ltr"><div><div dir="ltr">On Fri, 11 Sep 2015 at 10:41 Herbert Kruitbosch <<a href="mailto:python-dev@herbertkruitbosch.com">python-dev@herbertkruitbosch.com</a>> wrote:<br></div>
<div dir="ltr"><u></u><br></div>
<blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex;"><div><div>data_sorted = sort(data, key = #1[0])<br></div>
</div>
</blockquote><div> </div>
<div>That syntax won't work because `#` is used to start a comment and there is no way to disambiguate that in the grammar.<br></div>
</div>
</div>
</blockquote><div> </div>
<div>Obviously :) The #-syntax is used by Mathematica, which is why I used it here. As you stated, it is not adequate for python3. You could imagine a $n or ***n syntax. I'm not in any way well informed on the python3 syntax, nor what would be aesthetically appealing and readable.<br></div>
<div> </div>
<blockquote type="cite"><div dir="ltr"><div><blockquote style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204, 204, 204);border-left-style:solid;padding-left:1ex;"><div><div>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.<br></div>
<div> </div>
<div>Notice that #1[0] does not seem like partial function application, however it is if you (C++'isly) assume that the deference operation [] is a function dereference(subscriptable, subscript).<br></div>
<div> </div>
<div>Obviously, I am only expecting that you get these type of suggestions all the time and that there is a good change you do not find it adequate for many reasons, for example keeping the language compact. I this case, I would also like to hear so.<br></div>
</div>
</blockquote><div> </div>
<div>In my code the few times I want partial function applications I have found the functions in the operator module meet that need, else functools.partial or a quickly written closure do the trick. I don't think dedicated syntax is warranted when those other options already exist  to meet the same need.<br></div>
</div>
</div>
</blockquote><div> </div>
<div>I would guess it depends on personal preference. And like you stated, there are many clear and intuitive workarounds. I never got to the point where functools.partial and operator.* became part of my coding equipment, and I  would adore this feature. I'm very curious if there are more people on my team, but am also interested to hear about opinions against such a feature.<br></div>
<div> </div>
<blockquote type="cite"><div dir="ltr"><div><div>Thanks for the suggestion!<br></div>
</div>
</div>
</blockquote><div> </div>
<div>No problem, and thank you for reading it :)<br></div>
<div> </div>
<div>Herbert</div>
</body>
</html>