diff -r c839ec888e71 Doc/library/cmath.rst --- a/Doc/library/cmath.rst Wed Aug 10 21:03:23 2016 -0700 +++ b/Doc/library/cmath.rst Thu Aug 11 20:27:20 2016 -0700 @@ -253,6 +253,10 @@ The mathematical constant *e*, as a float. +.. data:: tau + + The mathematical constant *τ*, as a float. + .. index:: module: math Note that the selection of functions is similar, but not identical, to that in diff -r c839ec888e71 Doc/library/math.rst --- a/Doc/library/math.rst Wed Aug 10 21:03:23 2016 -0700 +++ b/Doc/library/math.rst Thu Aug 11 20:27:20 2016 -0700 @@ -426,6 +426,9 @@ The mathematical constant e = 2.718281..., to available precision. +.. data:: tau + + The mathematical constant τ = 6.283185..., to available precision. .. data:: inf diff -r c839ec888e71 Lib/test/test_math.py --- a/Lib/test/test_math.py Wed Aug 10 21:03:23 2016 -0700 +++ b/Lib/test/test_math.py Thu Aug 11 20:27:20 2016 -0700 @@ -197,7 +197,7 @@ def testConstants(self): self.ftest('pi', math.pi, 3.1415926) self.ftest('e', math.e, 2.7182818) - self.ftest('tau', math.tau, 2*math.pi) + self.assertEqual(math.tau, 2*math.pi) def testAcos(self): self.assertRaises(TypeError, math.acos) diff -r c839ec888e71 Modules/cmathmodule.c --- a/Modules/cmathmodule.c Wed Aug 10 21:03:23 2016 -0700 +++ b/Modules/cmathmodule.c Thu Aug 11 20:27:20 2016 -0700 @@ -1239,6 +1239,7 @@ PyModule_AddObject(m, "pi", PyFloat_FromDouble(Py_MATH_PI)); PyModule_AddObject(m, "e", PyFloat_FromDouble(Py_MATH_E)); + PyModule_AddObject(m, "tau", PyFloat_FromDouble(Py_MATH_TAU)); /* 2pi */ /* initialize special value tables */