PEP 3131: Supporting Non-ASCII Identifiers

Steven D'Aprano steve at REMOVE.THIS.cybersource.com.au
Sun May 13 19:35:19 EDT 2007


On Sun, 13 May 2007 15:35:15 -0700, Alex Martelli wrote:

> Homoglyphic characters _introduced by accident_ should not be discounted
> as a risk
...
> But when something similar
> happens to somebody using a sufficiently fancy text editor to input
> source in a programming language allowing arbitrary Unicode letters in
> identifiers, the damage (the sheer waste of developer time) can be much
> more substantial -- there will be two separate identifiers around, both
> looking exactly like each other but actually distinct, and unbounded
> amount of programmer time can be spent chasing after this extremely
> elusive and tricky bug -- why doesn't a rebinding appear to "take", etc.
> With some copy-and-paste during development and attempts at debugging,
> several copies of each distinct version of the identifier can be spread
> around the code, further hampering attempts at understanding.


How is that different from misreading "disk_burnt = True" as "disk_bumt =
True"? In the right (or perhaps wrong) font, like the ever-popular Arial,
the two can be visually indistinguishable. Or "call" versus "cal1"?

Surely the correct solution is something like pylint or pychecker? Or
banning the use of lower-case L and digit 1 in identifiers. I'm good with
both.


-- 
Steven.




More information about the Python-list mailing list