<div dir="ltr">I don't think this change makes sense, but if it's done, there should be another change, with actual implications:<div>There is no way to express the types of the parameters in a lambda - `lambda x: int : x` is obviously a syntax error. Replacing the colon with a different symbol, such as "=>" will make this possible:</div><div><br></div><div> def x => x<br></div><div> def x: int => x</div><div> def x: int -> int => x<br></div><div><br></div><div>It will also give one less meaning to the colon.</div><div><br></div><div>Elazar</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 21, 2018 at 6:28 PM MRAB <<a href="mailto:python@mrabarnett.plus.com">python@mrabarnett.plus.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 2018-08-22 01:25, Jonathan Fine wrote:<br>
> Hi Abe<br>
> <br>
> Summary: You've done good work here. I've skim read the 2006<br>
> discussion you found.<br>
> <br>
> You wrote:<br>
> <br>
>> I'm trying to dig up past threads about alternatives to lambda because I<br>
>> would be astonished if "def" hadn't been considered and rejected for some<br>
>> reason. What I've found so far is this unreassuring post from Guido back in<br>
>> 2006<br>
> <br>
>> [Python-Dev] Let's just *keep* lambda<br>
>> <a href="https://mail.python.org/pipermail/python-dev/2006-February/060415.html" rel="noreferrer" target="_blank">https://mail.python.org/pipermail/python-dev/2006-February/060415.html</a><br>
> <br>
> This is an excellent piece of work. I'm most grateful. Here's what Guido said:<br>
> <br>
>> After so many attempts to come up with an alternative for lambda,<br>
>> perhaps we should admit defeat. I've not had the time to follow the<br>
>> most recent rounds, but I propose that we keep lambda, so as to stop<br>
>> wasting everybody's talent and time on an impossible quest.<br>
> <br>
> I've quickly read through the posts that followed Guido's message,<br>
> picked out the ones that interest me. Here's a list.<br>
> <br>
>> <a href="https://mail.python.org/pipermail/python-dev/2006-February/060487.html" rel="noreferrer" target="_blank">https://mail.python.org/pipermail/python-dev/2006-February/060487.html</a><br>
>> <a href="https://mail.python.org/pipermail/python-dev/2006-February/060474.html" rel="noreferrer" target="_blank">https://mail.python.org/pipermail/python-dev/2006-February/060474.html</a><br>
>> <a href="https://mail.python.org/pipermail/python-dev/2006-February/060471.html" rel="noreferrer" target="_blank">https://mail.python.org/pipermail/python-dev/2006-February/060471.html</a><br>
>> <a href="https://mail.python.org/pipermail/python-dev/2006-February/060445.html" rel="noreferrer" target="_blank">https://mail.python.org/pipermail/python-dev/2006-February/060445.html</a><br>
>> <a href="https://mail.python.org/pipermail/python-dev/2006-February/060435.html" rel="noreferrer" target="_blank">https://mail.python.org/pipermail/python-dev/2006-February/060435.html</a><br>
>> <a href="https://mail.python.org/pipermail/python-dev/2006-February/060431.html" rel="noreferrer" target="_blank">https://mail.python.org/pipermail/python-dev/2006-February/060431.html</a><br>
>> <a href="https://mail.python.org/pipermail/python-dev/2006-February/060470.html" rel="noreferrer" target="_blank">https://mail.python.org/pipermail/python-dev/2006-February/060470.html</a><br>
> <br>
> And one of the messages had a link to still live and excellent page<br>
> <br>
>> <a href="https://wiki.python.org/moin/AlternateLambdaSyntax" rel="noreferrer" target="_blank">https://wiki.python.org/moin/AlternateLambdaSyntax</a><br>
> <br>
> This page lists over 100 suggestions, mostly variants. So far as I can<br>
> see, my simple proposal isn't listed on that page. The page also says<br>
> <br>
Hmm.<br>
<br>
That lists:<br>
<br>
def (a, b, c): return f(a) + o(b) - o(c)<br>
<br>
and:<br>
<br>
def (a, b, c) = f(a) + o(b) - o(c)<br>
<br>
but not:<br>
<br>
def (a, b, c): f(a) + o(b) - o(c)<br>
<br>
>> **Definitely Desirable Features**<br>
> [snip]<br>
>> *More friendly to inexperienced users*<br>
> [snip]<br>
>> Compared to other Python keywords, 'lambda' is rather esoteric.<br>
>> In the challenge for "farthest outside day-to-day English usage",<br>
>> its closest competitor would probably be 'assert', as even 'def'<br>
>> and 'elif' are just abbreviations for 'define' and 'else if'. Use of<br>
>> simpler keywords may make deferred expressions appear less<br>
>> intimidating than they seem with the current unusual keyword.<br>
> <br>
> The word 'deferred' appears 7 times on the page. It also appears in<br>
> the python-dev messages.<br>
> <br>
> If someone with more time and less bias then myself were to summarise<br>
> this discussion from 2006, I'd be most grateful, and they'd have<br>
> material for a great blog post.<br>
> <br>
> Finally, many thanks to Abe for finding this gem, and countless<br>
> people's hard work in keeping it alive to be found. Backwards<br>
> compatibility is there for a reason.<br>
> <br>
_______________________________________________<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" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/codeofconduct/</a><br>
</blockquote></div></div>