Skip to content

gh-132246: Add special buffer methods to C API Type Object docs #132247

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
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

cmaloney
Copy link
Contributor

@cmaloney cmaloney commented 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.


📚 Documentation preview 📚: https://cpython-previews--132247.org.readthedocs.build/

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.
@@ -325,9 +325,16 @@ sub-slots
+---------------------------------------------------------+-----------------------------------+---------------+
| |
+---------------------------------------------------------+-----------------------------------+---------------+
| :c:member:`~PyBufferProcs.bf_getbuffer` | :c:func:`getbufferproc` | |
| :c:member:`~PyBufferProcs.bf_getbuffer` | :c:func:`getbufferproc` | :meth:`\ |
Copy link
Contributor Author

@cmaloney cmaloney Apr 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The :meth: references make it link to the right document; can also match the other cases and not use. The __release_buffer__ is one character wider than the table column even without the :meth: pieces...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review docs Documentation in the Doc dir skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant