[Python-ideas] Visually confusable unicode characters in identifiers

Massimo DiPierro massimo.dipierro at gmail.com
Mon Oct 1 19:18:31 CEST 2012


The great thing about open source is that is has brought the world together. I am not an english speaker and I learned the meaning of IF, THEN, FOR, WHILE, not in the context of the English language, but as keywords of the Basic programming language. The fact that they are english words has is accidental. The great thing about code is (used to be) that anybody can read and understand what others write.

When I used program in Italy, I had to deal with latin-1 characters. This was never a problem. Not even in Cobol, Basic, Clipper, or Paradox because data should be separated from code. Data may contain latin-1 or unicode or whatever. Code always contains ASCII and if one does not mix the two there is never a problem.

Allowing unicode in variable names blurs this separation. It makes code written people speaking one language unreadable by people speaking a different language.

I should point out that most of my students are Chinese. They do not have any problem with reading and writing code using the english alphabet.

Any one of us could design better power plugs for our homes. That does not mean it would be a good idea to do so.

Massimo

On Oct 1, 2012, at 11:43 AM, Robert Kern wrote:

> On 10/1/12 5:07 PM, Mathias Panzenböck wrote:
>> I still don't understand why unicode characters are allowed at all in identifier
>> names. Is the reason for this written down somewhere?
> 
> http://www.python.org/dev/peps/pep-3131/#rationale
> 
> -- 
> Robert Kern
> 
> "I have come to believe that the whole world is an enigma, a harmless enigma
> that is made terrible by our own mad attempt to interpret it as though it had
> an underlying truth."
>  -- Umberto Eco
> 
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas




More information about the Python-ideas mailing list