Title: PEP 689 -- Add an unstable C-API tier · Issue #91744 · python/cpython · GitHub
Open Graph Title: PEP 689 -- Add an unstable C-API tier · Issue #91744 · python/cpython
X Title: PEP 689 -- Add an unstable C-API tier · Issue #91744 · python/cpython
Description: On python-dev, it became clear that it would be useful to have a “semi-stable” “unstable” C-API tier which will stay stable within a minor release. This API will go in a new directory (Include/unstable/) - see Nick's reply You'll need to...
Open Graph Description: On python-dev, it became clear that it would be useful to have a “semi-stable” “unstable” C-API tier which will stay stable within a minor release. This API will go in a new directory (Include/unst...
X Description: On python-dev, it became clear that it would be useful to have a “semi-stable” “unstable” C-API tier which will stay stable within a minor release. This API will go in a new directory (Include/unst...
Opengraph URL: https://github.com/python/cpython/issues/91744
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PEP 689 -- Add an unstable C-API tier","articleBody":"On [python-dev](https://mail.python.org/archives/list/python-dev@python.org/thread/MA4FQ7G6F35NG3TUN6RQPXRGXTYMFMDY/#MA4FQ7G6F35NG3TUN6RQPXRGXTYMFMDY), it became clear that it would be useful to have a ~~“semi-stable”~~ “unstable” C-API tier which will stay stable within a minor release.\r\n\r\n- [x] This API will go in a new directory (`Include/unstable/`) - see [Nick's reply](https://mail.python.org/archives/list/python-dev@python.org/message/CTKKTHUV5R2A2RRN5DM32UQFNC42DDGJ/)\r\nYou'll need to #define `Py_USING_UNSTABLE_API`.\r\n (name still up for bikeshedding).\r\n\r\n- [x] Since we're nearing Beta and there's no rush to break things, in 3.11 \r\nyou only get a warning if you try to use it without the opt-in #define. \r\nIn 3.12 it'll fail.\r\n\r\n- [x] The functions will be renamed to drop the leading underscore. The old \r\nnames will be available, and may be removed \r\nwhenever the API changes. (Ideally, the underscore should always mark \r\nAPI that's fully private with no guarantees at all.)\r\n\r\n- [ ] Get SC approval (this is now PEP-689 that will need acceptance)\r\n\r\n- The API will be stable during a minor release. (As usual, for extreme \r\ncases, exceptions are possible with SC approval.)\r\n\r\n- Docs:\r\n - [x] Update https://devguide.python.org/c-api/\r\n - [ ] Update https://docs.python.org/3.10/c-api/stable.html\r\n - [x] Add individual reference entries for the API\r\n - [x] Document the new opt-in macro\r\n\r\n- [ ] All ununstable API should be tested\r\n - [x] PEP-523 PyCode_* functions: tested in test_code\r\n - [ ] ...\r\n\r\nWhat should be here:\r\n\r\n- [ ] Functions added in PEP-523\r\n- [x] PyCode_New, PyCode_NewWithPosOnlyArgs\r\n- [ ] Ideally anything documented as subject to change between minor \r\nreleases. (To be kind to users, if something is added later we should \r\nagain have one release of compiler warnings before requiring the opt-in. \r\nUnless that API just changed and users would get errors anyway.)\r\n- [ ] Cinder's dict writing API looks like it would feel at home here: https://github.com/python/cpython/issues/91052#issuecomment-1093945876\r\n- [ ] PyBytesObject.ob_shash sounds like a good candidate: see https://discuss.python.org/t/15108\r\n- [ ] non-opaque access to frame structs and any other key APIs needed to\r\nimplement alternate eval loops with comparable performance to the default\r\neval loop (unless \u0026 until we can figure out stable public APIs that can\r\ndeliver equivalent performance) - see [Nick's reply](https://mail.python.org/archives/list/python-dev@python.org/message/CW543RWJU6EWAPTWCDDHEUS37UHSAU5I/)\r\n- [ ] C APIs that provide access to compiled code whether in AST or opcode\r\nform (the API itself may be stable, but the compiled code isn't, so this is\r\nkinda covered by your last point) - see [Nick's reply](https://mail.python.org/archives/list/python-dev@python.org/message/CW543RWJU6EWAPTWCDDHEUS37UHSAU5I/)\r\n- [ ] `_Py_HashDouble`, see [comment below](https://github.com/python/cpython/issues/91744#issuecomment-1111105784)\r\n\r\n---\r\nFirst PR: https://github.com/python/cpython/pull/91789","author":{"url":"https://github.com/encukou","@type":"Person","name":"encukou"},"datePublished":"2022-04-20T13:50:31.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":30},"url":"https://github.com/91744/cpython/issues/91744"}
| 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:1b69908e-1190-ddd8-8585-3646801136b8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B310:21FEDA:2280A4F:2F1589C:696ACF78 |
| html-safe-nonce | 735f8abc05d376e3eeed8c927ae53a2fb407dc1fb97aa620fe971c0557519e11 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMzEwOjIxRkVEQToyMjgwQTRGOjJGMTU4OUM6Njk2QUNGNzgiLCJ2aXNpdG9yX2lkIjoiNzc3MzE5MTY3NzA0NzEzMjAyNCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 337ee47d857a3c3e6105da7ddf1bbbfee7f4e7da86fda903d874945aae9b35b0 |
| hovercard-subject-tag | issue:1209721401 |
| 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/91744/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0022cfd67125d7052eaa822249a9d0d5833afea2c0990926cdb2366fa1296632/python/cpython/issues/91744 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0022cfd67125d7052eaa822249a9d0d5833afea2c0990926cdb2366fa1296632/python/cpython/issues/91744 |
| og:image:alt | On python-dev, it became clear that it would be useful to have a “semi-stable” “unstable” C-API tier which will stay stable within a minor release. This API will go in a new directory (Include/unst... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | encukou |
| hostname | github.com |
| expected-hostname | github.com |
| None | c785f4ce187e9e7331257791b36ddee01625bb8e292a9b4fe2c16d4c006abf5d |
| 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 | c718a376fcf780eb22089171adb84a543f660bf7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width