Title: Please add `getbufferproc` and `releasebufferproc` to the limited API headers · Issue #98410 · python/cpython · GitHub
Open Graph Title: Please add `getbufferproc` and `releasebufferproc` to the limited API headers · Issue #98410 · python/cpython
X Title: Please add `getbufferproc` and `releasebufferproc` to the limited API headers · Issue #98410 · python/cpython
Description: Feature or enhancement Starting with Python 3.11 the Py_Buffer API has been made available in the limited API, including the bf_getbuffer and bf_releasebuffer type slots. However the definitions for the function pointer types stored in t...
Open Graph Description: Feature or enhancement Starting with Python 3.11 the Py_Buffer API has been made available in the limited API, including the bf_getbuffer and bf_releasebuffer type slots. However the definitions fo...
X Description: Feature or enhancement Starting with Python 3.11 the Py_Buffer API has been made available in the limited API, including the bf_getbuffer and bf_releasebuffer type slots. However the definitions fo...
Opengraph URL: https://github.com/python/cpython/issues/98410
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Please add `getbufferproc` and `releasebufferproc` to the limited API headers","articleBody":"# Feature or enhancement\r\n\r\nStarting with Python 3.11 the Py_Buffer API has [been made available in the limited API](https://github.com/python/cpython/issues/89622), including the `bf_getbuffer` and `bf_releasebuffer` type slots.\r\n\r\nHowever the definitions for the function pointer types stored in those slots, `getbufferproc` and `releasebufferproc` are still [only defined when including \"cpython\" headers](https://github.com/python/cpython/blob/c051d55ddb29c4ff7b1fcc65971535f78369ffc0/Include/cpython/object.h#L54-L55).\r\n\r\nThis means on the limited API starting with Python 3.11 it is now possible to do `PyType_GetSlot(Py_TYPE(obj), Py_bf_getbuffer)`, however the `void *` returned does not have a function pointer type available which it can be cast to (unless the user adds this typedef themselves in their own code).\r\n\r\n# Pitch\r\n\r\nThis is a relatively straightforward change to make use of these type slots more convenient on the limited API.\r\n\r\nI wrote an initial implementation at https://github.com/python/cpython/pull/31158. A couple of tiny tweaks beyond moving the typedefs was necessary so that forward definitions continued to function. Please see that PR for the detail.\r\n","author":{"url":"https://github.com/davidhewitt","@type":"Person","name":"davidhewitt"},"datePublished":"2022-10-18T18:54:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/98410/cpython/issues/98410"}
| 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:9a1393a8-3d3c-15c8-420b-ab5bc5307b28 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E230:87E17:D30967:11CCA45:696AC359 |
| html-safe-nonce | e9b17ed75c01fafa243ba83948d650eb006b018dd3ae5b3944eff9044395895e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjMwOjg3RTE3OkQzMDk2NzoxMUNDQTQ1OjY5NkFDMzU5IiwidmlzaXRvcl9pZCI6IjMxNTI1NzcyMTYxODAzMDY3NzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7f20de6a11401eb080dca32c37f8162cf942ea8208aabf79240de1be4c96f028 |
| hovercard-subject-tag | issue:1413696931 |
| 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/98410/issue_layout |
| twitter:image | https://opengraph.githubassets.com/60bca0f7d3240e3290b17d4c9c85ec41ddab9e7b5dc6125ab41b266831aab6e3/python/cpython/issues/98410 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/60bca0f7d3240e3290b17d4c9c85ec41ddab9e7b5dc6125ab41b266831aab6e3/python/cpython/issues/98410 |
| og:image:alt | Feature or enhancement Starting with Python 3.11 the Py_Buffer API has been made available in the limited API, including the bf_getbuffer and bf_releasebuffer type slots. However the definitions fo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | davidhewitt |
| hostname | github.com |
| expected-hostname | github.com |
| None | 986b6a1d774985095564e64d6963d11f094da3d0e2bfda2ab1a27d63662eb033 |
| 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 | 89ad2112b9c4e11df6a0c13c8c1f8eedd36b0977 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width