Nice idea, BUT... Not sure how a parser addition that supports it would go. Imagine this: if you did a one-line function: def test(x): print(x) Python could interpret it two ways: `def` `name` `lparen` `name` `rparen` `colon`... OR, it could see it as a lambda-like thingamajig and throw a syntax error. And, if someone accidentally wrote: def (x): print(x) 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. And, it just would be odd in general. On Thu, Sep 19, 2013 at 3:54 PM, Ben Gift <benhgift at gmail.com> wrote: > I think the lambda keyword is difficult to understand for many people. It > would be more pythonic to use an empty def call instead. > > For instance this: > > words.sort(key = lambda x: x[2]) > > could look like this: > > words.sort(key = def (x): x[2]) > > It's obvious and explicit that we're creating an unnamed, anonymous > function this way. > > _______________________________________________ > Python-Dev mailing list > Python-Dev at python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com > > -- Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130919/c3382176/attachment.html>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4