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

Rustom Mody rustompmody at gmail.com
Thu Jul 21 02:14:24 EDT 2016


On Thursday, July 21, 2016 at 10:24:42 AM UTC+5:30, Pavol Lisy wrote:
>
> On 7/20/16, Danilo J. S. Bellini <danilo.... at gmail.com <javascript:>> 
> wrote:
>
> > 4. Unicode have more than one codepoint for some symbols that look alike,
> > for example "Σ𝚺𝛴𝜮𝝨𝞢" are all valid uppercase sigmas. There's also 
> "∑",
> > but this one is invalid in Python 3. The italic/bold/serif distinction
> > seems enough for a distinction, and when editing a code with an Unicode
> > char like that, most people would probably copy and paste the symbol
> > instead of typing it, leading to a consistent use of the same symbol.
>
> I am not sure what do you like to say, so for sure some info:
>
> PEP-3131 (https://www.python.org/dev/peps/pep-3131/): "All identifiers
> are converted into the normal form NFKC while parsing; comparison of
> identifiers is based on NFKC."
>
> From this point of view all sigmas are same:
>
>   set(unicodedata.normalize('NFKC', i) for i in "Σ𝚺𝛴𝜮𝝨𝞢")  == {'Σ'} 
> <http://python.org/psf/codeofconduct/>
>

Nice!

>>> Σ = 1
>>> 𝚺 = Σ + 1
>>> 𝛴
2


But not enough

>>> А = 1
>>> A = A + 1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'A' is not defined
 

Moral: The coarser the equivalence-relation the better (within reasonable 
limits!)
NFKC-equality i coarser than literal-codepoint equality.  ∴ Better
But not coarse enough.  After all identifiers are meant to identify!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160720/8e988ee5/attachment-0001.html>


More information about the Python-ideas mailing list