unicode as valid naming symbols

MRAB python at mrabarnett.plus.com
Wed Mar 26 03:56:00 CET 2014

On 2014-03-25 22:47, Ethan Furman wrote:
> On 03/25/2014 12:29 PM, Mark H Harris wrote:
>> On 3/25/14 2:24 PM, MRAB wrote:
>>> It's explained in PEP 3131.
>>> Basically, a name should to start with a letter (this has been extended
>>> to include Chinese characters, etc) or an underscore.
>>> λ is a classified as Lowercase_Letter.
>>> √ is classified as Math_Symbol.
>>     Thanks much!  I'll note that for improvements. Any unicode symbol (that is not a number) should be allowed as an
>> identifier.
> No, it shouldn't.  Doing so would mean we could not use √ as the square root operator in the future.
Or as a root operator, e.g. 3 √ x (the cube root of x).

> Identifiers are made up of letters, numbers, and the underscore.  Considering all the unicode letters and unicode
> numbers out there, you shouldn't be lacking for names.

More information about the Python-list mailing list