<p dir="ltr">It's been raised a few times, but the problem is that there's no evidence that anyone actually needs a short way to perform composition - notice the composition operation's never even been added to functools. If you do want to make that case though then there's nothing stopping you :-)</p>
<div class="gmail_quote">On 8 Apr 2014 22:10, "Michael Mitchell" <<a href="mailto:epsilonmichael@gmail.com">epsilonmichael@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">I haven't been following this thread too closely, so please stop me if this has been covered, but has overloading the @ operator as function composition been considered yet?<div><br></div><div>An example would be </div>
<div><br></div><div>filter(a @ b, lst)</div><div><br></div><div>as opposed to</div><div><br></div><div>filter(lambda x: a(b(x)), lst)</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Apr 6, 2014 at 6:51 PM, Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Mon, Apr 7, 2014 at 12:20 AM, Steven D'Aprano <<a href="mailto:steve@pearwood.info" target="_blank">steve@pearwood.info</a>> wrote:<br>
> On Sun, Apr 06, 2014 at 11:02:00PM +0100, Nathaniel Smith wrote:<br>
>> On Sun, Mar 16, 2014 at 1:05 PM, Nick Coghlan <<a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>> wrote:<br>
>> > Aye, but at the moment it makes sense to wait and see if there is even<br>
>> > an argument to be had - Nathaniel may decide that even after reviewing<br>
>> > the question seriously, he doesn't want to propose a right associative<br>
>> > operator :)<br>
>><br>
>> And indeed, that does seem to be the way things have worked out :-).<br>
>> <a href="http://mail.scipy.org/pipermail/numpy-discussion/2014-April/069834.html" target="_blank">http://mail.scipy.org/pipermail/numpy-discussion/2014-April/069834.html</a><br>
><br>
> That's a shame in one way -- for anyone using operator overloading to<br>
> define their own DSL, there's only ** if you want a right-associative<br>
> operator to overload. Still, that's an extremely marginal, and<br>
> hypothetical, use-case. Left-associative it is.<br>
><br>
> Was that the last blocker for the PEP?<br>
<br>
</div>Pretty much. Just posted to python-dev:<br>
<a href="https://mail.python.org/pipermail/python-dev/2014-April/133791.html" target="_blank">https://mail.python.org/pipermail/python-dev/2014-April/133791.html</a><br>
<span><font color="#888888"><br>
-n<br>
</font></span><div><br>
--<br>
Nathaniel J. Smith<br>
Postdoctoral researcher - Informatics - University of Edinburgh<br>
<a href="http://vorpus.org" target="_blank">http://vorpus.org</a><br>
</div><div><div>_______________________________________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org" target="_blank">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</div></div></blockquote></div><br></div>
</blockquote></div>