[Python-ideas] π = math.pi

Serhiy Storchaka storchaka at gmail.com
Sat Jun 3 08:51:50 EDT 2017


03.06.17 03:31, Guido van Rossum пише:
> OK, I think this discussion is pretty much dead then. We definitely 
> shouldn't allow math operators in identifiers, otherwise in Python 4 or 
> 5 we couldn't introduce them as operators.

Sorry. I proposed this idea as a joke. math.π is useless, but mostly 
harmless. But I don't want to change Python grammar.

The rule for Python identifiers already is not easy, there is no simple 
regular expression for them, and I'm sure most tools proceeding Python 
sources (even the tokenize module and IDLE) do not handle all Python 
identifier correctly. For example they don't recognize the symbol ℘ 
(U+2118, SCRIPT CAPITAL P) as a valid identifier.



More information about the Python-ideas mailing list