[Python-ideas] allow `lambda' to be spelled λ

Nick Coghlan ncoghlan at gmail.com
Fri Jul 15 05:01:05 EDT 2016

On 15 July 2016 at 09:18, Giampaolo Rodola' <g.rodola at gmail.com> wrote:
> On Fri, Jul 15, 2016 at 12:27 AM, Paul Moore <p.f.moore at gmail.com> wrote:
>> All of which is tangential to the question here which is about using
>> Unicode in a *keyword*.
> I would personally feel bad about using non-ASCII or even non-english
> variable names in code. Heck, I feel so bad about non-ASCII in code that I
> even mispell the à in my last name (Rodolà) and type a' instead. Extending
> that to a keyword sounds even worse.

Unicode-as-identifier makes a lot of sense in situations where you
have a data-driven API (like a pandas dataframe or
collections.namedtuple) and the data you're working with contains
Unicode characters. Hence my choice of example in
- it's easy to imagine cases where the named tuple attributes are
coming from a data source like headers in a CSV file, and in
situations like that, folks shouldn't be forced into awkward
workarounds just because their data contains non-ASCII characters.

> When Python 3 was cooking I remember there were debates on whether removing
> "lambda". It stayed, and I'm glad it did, but IMO that should tell it's not
> important enough to deserve the breakage of a rule which has never been
> broken (non-ASCII for a keyword).

This I largely agree with, though. The *one* argument for improvement
I see potentially working is the one I advanced back in March when I
suggested that adding support for Java's lambda syntax might be worth
doing: https://mail.python.org/pipermail/python-ideas/2016-March/038649.html

However, any proposals along those lines need to be couched in terms
of how they will advance the Python ecosystem as a whole, rather than
"I like using lambda expressions in my code, but I don't like the
'lambda' keyword", as we have a couple of decades worth of evidence
informing us that the latter isn't sufficient justification for


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list