PEP 3131: Supporting Non-ASCII Identifiers

Aldo Cortesi aldo at nullcube.com
Tue May 15 06:43:31 EDT 2007


Thus spake Steven D'Aprano (steven at REMOVE.THIS.cybersource.com.au):

> >> Me, I try to understand a patch by reading it. Call me old-fashioned.
> >
> > I concur, Aldo.  Indeed, if I _can't_ be sure I understand a patch, I
> > don't accept it -- I ask the submitter to make it clearer.
>
>
> Yes, but there is a huge gulf between what Aldo originally said he does
> ("visual inspection") and *reading and understanding the code*.

Let's set aside the fact that you're guilty of sloppy quoting here, since the
phrase "visual inspection" is yours, not mine. Regardless, your interpretation
of my words is just plain dumb. My phrasing was intended to draw attention to
the fact that one needs to READ code in order to understand it. You know - with
one's eyes. VISUALLY. And VISUAL INSPECTION of code becomes unreliable if this
PEP passes. 

> If I've understood Martin's post, the PEP states that identifiers are
> converted to normal form. If two identifiers look the same, they will be the
> same.

I'm sorry to have to tell you, but you understood Martin's post no better than
you did mine. There is no general way to detect homoglyphs and "convert them to
a normal form". Observe:

import unicodedata
print repr(unicodedata.normalize("NFC", u"\u2160"))
print u"\u2160"
print "I"


So, a round 0 for reading comprehension this lesson, I'm afraid. Better luck
next time.




Regards,




Aldo




-- 
Aldo Cortesi
aldo at nullcube.com
http://www.nullcube.com
Mob: 0419 492 863



More information about the Python-list mailing list