https://github.com/python/cpython/commit/7f3d7d06efd0e7ffa1ac1d07a15a3ae8121a020c
commit: 7f3d7d06efd0e7ffa1ac1d07a15a3ae8121a020c
branch: main
author: Vyron Vasileiadis <[email protected]>
committer: StanFromIreland <[email protected]>
date: 2026-09-08T16:01:58+01:00
summary:

gh-157135: Fix documentation errors in the `math.atan{2}pi` functions (#157136)

files:
M Doc/library/math.rst
M Modules/mathmodule.c

diff --git a/Doc/library/math.rst b/Doc/library/math.rst
index efe411e5a43f27d..70e61bb92fa7286 100644
--- a/Doc/library/math.rst
+++ b/Doc/library/math.rst
@@ -90,7 +90,7 @@ noted otherwise, all return values are floats.
 :func:`atan(x) <atan>`                                Arc tangent of *x*, in 
radians
 :func:`atanpi(x) <atanpi>`                            Arc tangent of *x*, in 
half-turns
 :func:`atan2(y, x) <atan2>`                           ``atan(y / x)``, in 
radians
-:func:`atan2pi(y, x) <atan2pi>`                       ``atan(y / x)``, in 
half-turns
+:func:`atan2pi(y, x) <atan2pi>`                       ``atanpi(y / x)``, in 
half-turns
 :func:`cos(x) <cos>`                                  Cosine of *x* radians
 :func:`cospi(x) <cospi>`                              Cosine of *x⋅π* radians
 :func:`sin(x) <sin>`                                  Sine of *x* radians
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index eaa1850b8aee1ac..7988a77ab0abcca 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -256,7 +256,7 @@ m_asinpi(double x)
 
 #ifndef HAVE_ATANPI
 /*
-   asin(x)/pi.  It conforms to C23 Annex 'F'.
+   atan(x)/pi.  It conforms to C23 Annex 'F'.
 */
 
 static double
@@ -274,7 +274,7 @@ m_atanpi(double x)
 
 #ifndef HAVE_ATAN2PI
 /*
-   asin(x)/pi.  It conforms to C23 Annex 'F'.
+   atan2(y, x)/pi.  It conforms to C23 Annex 'F'.
 */
 
 static double
@@ -1136,7 +1136,7 @@ FUNC1D(atanh, atanh, 0,
 FUNC1D(atanpi, m_atanpi, 0,
       "atanpi($module, x, /)\n--\n\n"
       "Return the arc tangent (measured in half-turns) of x.\n\n"
-      "The result is between 0 and 1.",
+      "The result is between -1/2 and 1/2.",
       "expected a number in range from -1 up to 1, got %s")
 FUNC1(cbrt, cbrt, 0,
       "cbrt($module, x, /)\n--\n\n"

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to