Title: Documentation errors in the new half-turn `*pi` functions · Issue #157135 · python/cpython · GitHub
Open Graph Title: Documentation errors in the new half-turn `*pi` functions · Issue #157135 · python/cpython
X Title: Documentation errors in the new half-turn `*pi` functions · Issue #157135 · python/cpython
Description: Bug description: Four statements added with the half-turn functions in GH-150555 describe a different function than the one they document. $ ./python -c 'import math; print(math.atanpi.__doc__); print(math.atanpi(-1), math.atan2pi(-1, -1...
Open Graph Description: Bug description: Four statements added with the half-turn functions in GH-150555 describe a different function than the one they document. $ ./python -c 'import math; print(math.atanpi.__doc__); pr...
X Description: Bug description: Four statements added with the half-turn functions in GH-150555 describe a different function than the one they document. $ ./python -c 'import math; print(math.atanpi.__doc__)...
Opengraph URL: https://github.com/python/cpython/issues/157135
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Documentation errors in the new half-turn `*pi` functions","articleBody":"### Bug description:\n\nFour statements added with the half-turn functions in GH-150555 describe a different function than the one they document.\n\n```\n$ ./python -c 'import math; print(math.atanpi.__doc__); print(math.atanpi(-1), math.atan2pi(-1, -1), math.atanpi(-1 / -1))'\nReturn the arc tangent (measured in half-turns) of x.\n\nThe result is between 0 and 1.\n-0.25 -0.75 0.25\n```\n\n- `atanpi`'s docstring in `Modules/mathmodule.c` says \"The result is between 0 and 1\". The range is -1/2 to 1/2, as `Doc/library/math.rst` states.\n- The trigonometric summary table in `Doc/library/math.rst` describes `atan2pi(y, x)` as \"`atan(y / x)`, in half-turns\". `atan` returns radians, and the entry for the function itself says `atanpi(y / x)`.\n- The comment above `m_atanpi` in `Modules/mathmodule.c` reads \"asin(x)/pi\". The function computes `atan(x)/pi`.\n- The comment above `m_atan2pi` in `Modules/mathmodule.c` reads \"asin(x)/pi\". The function computes `atan2(y, x)/pi`.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-157136\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/fedonman","@type":"Person","name":"fedonman"},"datePublished":"2026-09-07T21:12:19Z","url":"https://github.com/python/cpython/issues/157135"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:aaae9986-3cc4-1ff9-96a8-64746d0131dc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B37A:1CCECA:114CFB9:1717224:6B01F24D |
| html-safe-nonce | 1ca9f534cc1a055983997efb570a25060efc5f953524f0c318419074961f604f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzdBOjFDQ0VDQToxMTRDRkI5OjE3MTcyMjQ6NkIwMUYyNEQiLCJ2aXNpdG9yX2lkIjoiNTg0NzQyMjUyNTg4NTI0ODA3NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e357677f371c6cd53cda590221646fa3f27c4685743c3822706e07226c5d69ab |
| hovercard-subject-tag | issue:5379059988 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/157135/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a7d3179cf9374a23872896b69838bfeb7b43d13e7afa66d95fcabba79644fb48/python/cpython/issues/157135 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a7d3179cf9374a23872896b69838bfeb7b43d13e7afa66d95fcabba79644fb48/python/cpython/issues/157135 |
| og:image:alt | Bug description: Four statements added with the half-turn functions in GH-150555 describe a different function than the one they document. $ ./python -c 'import math; print(math.atanpi.__doc__); pr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fedonman |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width