[Idle-dev] unicode variable names

Guido van Rossum guido@python.org
Wed, 05 Apr 2000 10:21:37 -0400


> I want to use unicode varible names, i. e. non-english letters in variable 
> names.
> This will work fine in python 1.6 if I define them at runtime, using 
> mainpulations of the __dict__ dictionary, Where the names are strings.

> Qestions:
> 	1) Will future python accept unicode variables in source code?

Maybe in Python 3000.  Not anytime soon, at least not in an officially
"blessed" version.

> 	2) It seems like a very easily implemented, natural and
>	   desireable adjustment, is it?

There are major problems with this if you consider code portability.
WHen I was 18 and first started to program, I decided to write all my
code (including variable names, comments and string literals) in
English, even though my mother tongue is Dutch.  I have never
regretted this.  Much more of my code than I ever dreamed has found
its way all over the world.  If I had used Duch in my programs, they
would never have crossed the borders.

>     	3) Or is it so that the current implemntation of namespaces
>	   does allow sting names of variables and that would possibly
>	   disappear in another implemntation?

There is no implementation reason -- the implementation uses arbitrary
strings.

> 	4) Is it desireable to allow unicode variable names in
>	   sourcecode, like in Java. Is it desireable for JPython?

Since most computer systems used by programmers have hardly any
support for entering and displaying Unicode, this would again hamper
source code portability, so I'm not a big fan of this.

--Guido van Rossum (home page: http://www.python.org/~guido/)