unicode as valid naming symbols

Ian Kelly ian.g.kelly at gmail.com
Tue Mar 25 15:49:09 EDT 2014


On Tue, Mar 25, 2014 at 1:29 PM, Mark H Harris <harrismh777 at gmail.com> 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.

√ cannot be used in identifiers for the same reasons that + and ~
cannot: identifiers are intended to be alphanumeric. √ is not
currently the name of an operator, but who knows what may happen in
the future?

Python generally follows Annex 31 of the Unicode standard in this regard:

http://www.unicode.org/reports/tr31/



More information about the Python-list mailing list