[Python-ideas] math.tau

Victor Stinner victor.stinner at gmail.com
Mon Mar 16 16:15:01 CET 2015


Hi Anatoly,

It looks like you forgot to write the body of your email, there is no
text, only code?

2015-03-16 13:12 GMT+01:00 anatoly techtonik <techtonik at gmail.com>:
>>>> import math
>>>> math.tau
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> AttributeError: 'module' object has no attribute 'tau'
>>>> math.pi * 2
> 6.283185307179586

Once a year, someone asks for math.tau and then disappears. I don't
think that there is a real need to add math.tau. It's really trivial
to compute such constant in your own application or in the Python
interpreter. They are much more math constants, it's not useful to add
more constants to the math modules. We added recently math.inf and
math.nan which are float("int") and float("nan")! Even if I'm not
convinced that it was useful to add them :-p
http://bugs.python.org/issue23185
(see also http://bugs.python.org/issue23229 for cmath)

The previous attempt to add math.tau was rejected:
http://bugs.python.org/issue12345

Please read the issue for the rationale.

Victor


More information about the Python-ideas mailing list