Title: C API: Remove private C API functions (move them to the internal C API) · Issue #106320 · python/cpython · GitHub
Open Graph Title: C API: Remove private C API functions (move them to the internal C API) · Issue #106320 · python/cpython
X Title: C API: Remove private C API functions (move them to the internal C API) · Issue #106320 · python/cpython
Description: Over the years, we accumulated many private functions as part of the public C API header files. I propose to remove them: move them to the internal C API. If many C extensions are affected by these removals, it's a sign that we should co...
Open Graph Description: Over the years, we accumulated many private functions as part of the public C API header files. I propose to remove them: move them to the internal C API. If many C extensions are affected by these...
X Description: Over the years, we accumulated many private functions as part of the public C API header files. I propose to remove them: move them to the internal C API. If many C extensions are affected by these...
Opengraph URL: https://github.com/python/cpython/issues/106320
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"C API: Remove private C API functions (move them to the internal C API)","articleBody":"Over the years, we accumulated many private functions as part of the public C API header files. I propose to remove them: move them to the internal C API.\r\n\r\nIf many C extensions are affected by these removals, it's a sign that we should consider promoted used private functions as public functions: provide a better API, add error handling, write documentation, write tests.\r\n\r\n---\r\n\r\nSummary: **[My plan to clarify private vs public functions in Python 3.13](https://discuss.python.org/t/c-api-my-plan-to-clarify-private-vs-public-functions-in-python-3-13/30131)**\r\n\r\n* Private functions converted to public functions:\r\n\r\n * PyLong_AsInt(): issue #108444\r\n * Py_IsFinalizing(): PR #108032\r\n\r\n* Discussions:\r\n\r\n * [(pssst) Let’s treat all API in public headers as public](https://discuss.python.org/t/pssst-lets-treat-all-api-in-public-headers-as-public/28916)\r\n * [list of PyPI affected projects](https://github.com/python/cpython/issues/106320#issuecomment-1620773057)\r\n * [C API: How much private is the private _Py_IDENTIFIER() API?](https://discuss.python.org/t/c-api-how-much-private-is-the-private-py-identifier-api/29190) -- ``_Py_Identifier``\r\n * [_Py_c_xxx complex functions](https://github.com/python/cpython/issues/106320#issuecomment-1633302147) (ex: ``_Py_c_abs()``)\r\n * PR #107139: Add _PyTupleBuilder API to the internal C API\r\n\r\n* Notes:\r\n\r\n * While being private, [_PyBytes_Resize()](https://docs.python.org/dev/c-api/bytes.html#c._PyBytes_Resize) and [_PyTuple_Resize()](https://docs.python.org/dev/c-api/tuple.html#c._PyTuple_Resize) are documented\r\n * The private _PyCrossInterpreterData API is used by 3rd party project on PyPI: https://github.com/python/cpython/pull/107068#issuecomment-1648594654. I closed my PR #107068.\r\n\r\n---\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-106321\r\n* gh-106324\r\n* gh-106325\r\n* gh-106335\r\n* gh-106336\r\n* gh-106339\r\n* gh-106341\r\n* gh-106342\r\n* gh-106355\r\n* gh-106356\r\n* gh-106382\r\n* gh-106383\r\n* gh-106385\r\n* gh-106386\r\n* gh-106398\r\n* gh-106399\r\n* gh-106400\r\n* gh-106417\r\n* gh-106425\r\n* gh-106434\r\n* gh-107021\r\n* gh-107026\r\n* gh-107027\r\n* gh-107030\r\n* gh-107032\r\n* gh-107034\r\n* gh-107036\r\n* gh-107041\r\n* gh-107053\r\n* gh-107064\r\n* gh-107068\r\n* gh-107070\r\n* gh-107071\r\n* gh-107142\r\n* gh-107143\r\n* gh-107144\r\n* gh-107145\r\n* gh-107147\r\n* gh-107159\r\n* gh-107185\r\n* gh-107187\r\n* gh-108313\r\n* gh-108429\r\n* gh-108430\r\n* gh-108431\r\n* gh-108433\r\n* gh-108434\r\n* gh-108449\r\n* gh-108451\r\n* gh-108452\r\n* gh-108453\r\n* gh-108499\r\n* gh-108503\r\n* gh-108505\r\n* gh-108593\r\n* gh-108597\r\n* gh-108599\r\n* gh-108600\r\n* gh-108601\r\n* gh-108602\r\n* gh-108603\r\n* gh-108604\r\n* gh-108605\r\n* gh-108606\r\n* gh-108607\r\n* gh-108609\r\n* gh-108664\r\n* gh-108712\r\n* gh-108713\r\n* gh-108720\r\n* gh-108742\r\n* gh-108743\r\n* gh-108863\r\n* gh-111162\r\n* gh-111939\r\n* gh-128787\n* gh-128788\n* gh-128837\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2023-07-01T21:35:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":55},"url":"https://github.com/106320/cpython/issues/106320"}
| 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:caedbbd6-db52-a27e-42ee-61e1614beea1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BCE6:1D70BE:1849549:2073D60:6969BEB6 |
| html-safe-nonce | 3ab4c4d4d0fa01079a68b5873c324c635e6a76db9dd00115291274ba04fbe950 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0U2OjFENzBCRToxODQ5NTQ5OjIwNzNENjA6Njk2OUJFQjYiLCJ2aXNpdG9yX2lkIjoiODM1MDMxODk2NTMyNTE1MTkyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 862eae45521648fd8f5be3c1a74c62292a7f37be451faffdb76c8d2b4ab42c76 |
| hovercard-subject-tag | issue:1784268682 |
| 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/106320/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cbb13c61a3d6e6d2b8b4b037e087abb51127b5f35986b6b81386dc0aff390271/python/cpython/issues/106320 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cbb13c61a3d6e6d2b8b4b037e087abb51127b5f35986b6b81386dc0aff390271/python/cpython/issues/106320 |
| og:image:alt | Over the years, we accumulated many private functions as part of the public C API header files. I propose to remove them: move them to the internal C API. If many C extensions are affected by these... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vstinner |
| hostname | github.com |
| expected-hostname | github.com |
| None | acedec8b5f975d9e3d494ddd8f949b0b8a0de59d393901e26f73df9dcba80056 |
| 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 | 83c08c21cdda978090dc44364b71aa5bc6dcea79 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width