PEP 3131: Supporting Non-ASCII Identifiers

Torsten Bronger bronger at physik.rwth-aachen.de
Fri May 18 05:43:32 EDT 2007


Hallöchen!

Martin v. Löwis writes:

>> In <slrnf4gafq.v74.nick at irishsea.home.craig-wood.com>, Nick Craig-Wood
>> wrote:
>> 
>>> My initial reaction is that it would be cool to use all those
>>> great symbols.  A variable called OHM etc!
>> 
>> This is a nice candidate for homoglyph confusion.  There's the
>> Greek letter omega (U+03A9) Ω and the SI unit symbol (U+2126) Ω,
>> and I think some omegas in the mathematical symbols area too.
>
> Under the PEP, identifiers are converted to normal form NFC, and
> we have
>
> py> unicodedata.normalize("NFC", u"\u2126")
> u'\u03a9'
>
> So, OHM SIGN compares equal to GREEK CAPITAL LETTER OMEGA. It can't
> be confused with it - it is equal to it by the proposed language
> semantics.

So different unicode sequences in the source code can denote the
same identifier?

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
                                      Jabber ID: bronger at jabber.org
                      (See http://ime.webhop.org for ICQ, MSN, etc.)



More information about the Python-list mailing list