PEP 3131: Supporting Non-ASCII Identifiers
"Martin v. Löwis"
martin at v.loewis.de
Mon May 14 18:02:46 EDT 2007
> 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.
Regards,
Martin
More information about the Python-list
mailing list