[Python-ideas] π = math.pi

Terry Reedy tjreedy at udel.edu
Fri Jun 2 21:13:47 EDT 2017


On 6/2/2017 7:56 PM, Ivan Levkivskyi wrote:
> On 3 June 2017 at 01:29, Guido van Rossum 
> <guido at python.org 
> <mailto:guido at python.org>> wrote:
> 
>     Are those characters not considered Unicode letters? Maybe we could
>     add their category to the allowed set?
> 
> 
> Yes, they are not considered letters, they are in category Sm.

I presume that is Symbol - math.

> Unfortunately, +, -, |, and other symbol that clearly should not be in 
> identifiers are also in this category,
> so we cannot add the whole category. It is possible to include 
> particular ranges,

Having to test ranges will slow down identifier recognition.

> but there should be a discussion
> about what exactly can/should be included.

I believe the current python definition of 'identifier' is taken from 
the Unicode Standard for default identifiers.  Any change would have to 
be propagated to regex engines, IDEs, and anything else that parses 
python.  I suggest that you ask Martin Loewis for his opinion on 
changing the identifier definition.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list