Title: Deprecate PyComplexObject.cval and soft-deprecate _Py_c*() API · Issue #128813 · python/cpython · GitHub
Open Graph Title: Deprecate PyComplexObject.cval and soft-deprecate _Py_c*() API · Issue #128813 · python/cpython
X Title: Deprecate PyComplexObject.cval and soft-deprecate _Py_c*() API · Issue #128813 · python/cpython
Description: Proposal: Suggested by @vstinner in #124829 (comment). I would agree, as these routines could be useful (and it seems, they are used by few projects) to implement mathematical functions just like in the cmath module. No alternatives exis...
Open Graph Description: Proposal: Suggested by @vstinner in #124829 (comment). I would agree, as these routines could be useful (and it seems, they are used by few projects) to implement mathematical functions just like i...
X Description: Proposal: Suggested by @vstinner in #124829 (comment). I would agree, as these routines could be useful (and it seems, they are used by few projects) to implement mathematical functions just like i...
Opengraph URL: https://github.com/python/cpython/issues/128813
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Deprecate PyComplexObject.cval and soft-deprecate _Py_c*() API","articleBody":"### Proposal:\n\nSuggested by @vstinner in https://github.com/python/cpython/pull/124829#issuecomment-2588284712.\n\nI would agree, as these routines could be useful (and it seems, they are used by few projects) to implement mathematical functions just like in the cmath module. No alternatives exist.\n\nIt's also suggested to use a different convention for arguments: currently we pass them by value. We could use pointers to Py_complex struct instead. (Though my quick tests shows no measurable difference.)\n\nAlso, we should decide on naming. For `_Py_c_sum()` - `PyComplex_Add()` was suggested. But this looks misleading, as `PyComplex_` is a prefix for functions, operating with `PyObject*` arguments. Perhaps, rather we could instead use `Py_complex_add()` and `Py_complex_add_real()` (in the GNU GSL style). Current semi-private functions should be deprecated.\n\nEdit:\nThe C-API WG [decision](https://github.com/capi-workgroup/decisions/issues/56#issuecomment-3136108606): Soft-deprecate the _Py_c_*() functions and Deprecate PyComplexObject.cval.\n\n\nPrevious discussions:\n* https://github.com/python/cpython/issues/112019\n* https://github.com/python/cpython/issues/106320#issuecomment-1633302147\n\nOther:\n* https://github.com/capi-workgroup/decisions/issues/56\n* https://discuss.python.org/t/89919/\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-131703\n* gh-137261\n* gh-137271\n* gh-137579\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/skirpichev","@type":"Person","name":"skirpichev"},"datePublished":"2025-01-14T08:30:19.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/128813/cpython/issues/128813"}
| 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:02b69345-9bf7-351d-4439-1317fec38b8b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E6C2:1272F1:198AB34:2369C65:696AA60D |
| html-safe-nonce | 8f8ec42340236e54da87c502d5103f217f80b269c614d4d6f46217f13687d026 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNkMyOjEyNzJGMToxOThBQjM0OjIzNjlDNjU6Njk2QUE2MEQiLCJ2aXNpdG9yX2lkIjoiODAwNzQ5ODI3OTIzNjA1MjQ5MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 2d4677d741655f08d4e0464dc432ba895a08d07478999870e486a50256bac53f |
| hovercard-subject-tag | issue:2786543648 |
| 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/128813/issue_layout |
| twitter:image | https://opengraph.githubassets.com/87967e10fa7a14618f947d3398d15faad4e4522f7de0450c007b9bb2f6526b31/python/cpython/issues/128813 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/87967e10fa7a14618f947d3398d15faad4e4522f7de0450c007b9bb2f6526b31/python/cpython/issues/128813 |
| og:image:alt | Proposal: Suggested by @vstinner in #124829 (comment). I would agree, as these routines could be useful (and it seems, they are used by few projects) to implement mathematical functions just like i... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skirpichev |
| hostname | github.com |
| expected-hostname | github.com |
| None | a51f97dbb9326f71c08ecb61577457d543c602124d1a2672871258ef37ac5261 |
| 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 | 4bd0eac606c70914085176ef312ebdcd97a8cdf1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width