<div dir="ltr">Nice idea, BUT...<div><br></div><div>Not sure how a parser addition that supports it would go. Imagine this: if you did a one-line function:</div><div><br></div><div>def test(x): print(x)</div><div><br></div>

<div>Python could interpret it two ways:</div><div><br></div><div>`def` `name` `lparen` `name` `rparen` `colon`...</div><div><br></div><div>OR, it could see it as a lambda-like thingamajig and throw a syntax error. And, if someone accidentally wrote:</div>

<div><br></div><div>def (x): print(x)</div><div><br></div><div>Python should throw a syntax error. But it won't. And it'll take the person a tad bit to realize he forgot the function name. Whoops.</div><div><br></div>

<div>And, it just would be odd in general.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 19, 2013 at 3:54 PM, Ben Gift <span dir="ltr"><<a href="mailto:benhgift@gmail.com" target="_blank">benhgift@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>I think the lambda keyword is difficult to understand for many people. It would be more pythonic to use an empty def call instead. <br>

<br></div>For instance this:<br><br></div>    words.sort(key = lambda x: x[2])<br>
<br></div>could look like this:<br>  <br>    words.sort(key = def (x): x[2])<br><br></div>It's obvious and explicit that we're creating an unnamed, anonymous function this way. <br></div>
<br>_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com" target="_blank">https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Ryan
</div>