Skip to content

Add PEP 688 special buffer methods to C API Type Object and Buffer Protocol docs #132246

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cmaloney opened this issue Apr 7, 2025 · 1 comment
Labels
docs Documentation in the Doc dir topic-C-API

Comments

@cmaloney
Copy link
Contributor

cmaloney commented Apr 7, 2025

Documentation

Two special methods, __buffer__ and __release_buffer__ were added to Python 3.12 by PEP-688. The C API Type Object documentation for slots includes tp_as_buffer, and sub-slots bf_getbuffer, bf_releasebuffer but does not refer to the Python Data Model version of those. Add the missing references.

C API Type Object: https://docs.python.org/3/c-api/typeobj.html#tp-slots
Data Model: https://docs.python.org/3/reference/datamodel.html#emulating-buffer-types

Linked PRs

@cmaloney cmaloney added the docs Documentation in the Doc dir label Apr 7, 2025
cmaloney added a commit to cmaloney/cpython that referenced this issue Apr 7, 2025
Two special methods, __buffer__ and __release_buffer__ were added to
Python 3.12 by PEP 688. The C API Type Object documentation for slots
includes `tp_as_buffer`, and sub-slots `bf_getbuffer`, `bf_releasebuffer`
but does not refer to the Python Data Model version of those. Add the
missing references.
@cmaloney cmaloney changed the title Update C API Type Object Documentation to include PEP-688 Buffer Protocol special methods Add PEP 688 special buffer methods to C API Type Object docs Apr 7, 2025
@cmaloney cmaloney changed the title Add PEP 688 special buffer methods to C API Type Object docs Add PEP 688 special buffer methods to C API Type Object and Buffer Object docs Apr 7, 2025
@cmaloney cmaloney changed the title Add PEP 688 special buffer methods to C API Type Object and Buffer Object docs Add PEP 688 special buffer methods to C API Type Object and Buffer Protocol docs Apr 7, 2025
cmaloney added a commit to cmaloney/cpython that referenced this issue Apr 8, 2025
@cmaloney
Copy link
Contributor Author

cmaloney commented Apr 8, 2025

cc: @JelleZijlstra (PEP 688 Author)

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Apr 8, 2025
AA-Turner pushed a commit that referenced this issue May 1, 2025
…132282)

gh-132246: Add PEP 688 to C Buffer Protocol docs (GH-132249)
(cherry picked from commit 8421b64)

Co-authored-by: Cody Maloney <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir topic-C-API
Projects
Status: Todo
Development

No branches or pull requests

2 participants