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

Stephen J. Turnbull stephen at xemacs.org
Tue Jul 12 22:04:19 EDT 2016


Chris Angelico writes:

 > A variant Python would be welcome to translate all the operators
 > and keywords into single-character tokens, using Unicode symbols
 > for NOT EQUAL TO and so on - including using U+03BB in place of
 > 'lambda'.

Probably it would not be "welcome", except in the usual sense that
"Python is open source, you can do what you want".

There was extensive discussion about the issues surrounding the
natural languages used by programmers in source documentation (eg,
identifier choice and comments) at the time of PEP 263.  The mojibake
(choice of charset) problem has largely improved since then, thanks to
Unicode adoption, especially UTF-8.  But the "Tower of Babel" issue
has not.  Fundamentally, it's like women's clothes (they wear them to
impress, ie, communicate to, other women -- few men have the interest
to understand what is impressive ;-): programming is about programmers
communicating to other programmers.  Maintaining the traditional
spelling of keywords and operators is definitely useful for that
purpose.

This is not to say that individuals who want a personalized[1]
language are wrong, just that it would have a net negative impact on
communication in teams.

BTW, Barry long advocated use of some variant syntaxes (the one I like
to remember inaccurately is "><" instead of "!="), and in fact
provided an easter egg import (barry_is_flufl or something like that)
that changed the syntax to suit him.  I believe that module is pure
Python, so people who want to customize the lexical definition of
Python at the language level can do so AFAIK.  You could probably even
spell it "import λ等" (to take a very ugly page from the Book of GNU,
mixing scripts in a single word -- the Han character means "etc.").


Footnotes: 
[1]  I don't have a better word.  I mean something like "seasoned to
taste", almost "tasteful" but not quite.



More information about the Python-ideas mailing list