8000 gh-132246: Add special buffer methods to C API Type Object docs by cmaloney · Pull Request #132247 · python/cpython · GitHub
[go: up one dir, main page]

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

Merged
merged 3 commits into from
May 21, 2025

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/en/132247/c-api/typeobj.html#quick-reference

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.
@ZeroIntensity ZeroIntensity added the needs backport to 3.13 bugs and security fixes label Apr 21, 2025
Copy link
Member
@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

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

We could also expand the table so __release_buffer__ fits, but I don't have much of a preference.

@cmaloney
Copy link
Contributor Author

I tried a couple times to get my head around emacs table mode to automatedly do that but was unsuccessful, for one char I don't think worth the big diff. I may look at making all entries :meth: / full references, and expand the table a bit with that as an independent project.

@serhiy-storchaka serhiy-storchaka added the needs backport to 3.14 bugs and security fixes label May 8, 2025
@cmaloney
Copy link
Contributor Author

cc: @gpshead

@ambv ambv merged commit b529b60 into python:main May 21, 2025
32 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs May 21, 2025
@miss-islington-app
Copy link

Thanks @cmaloney for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 21, 2025
…pythongh-132247)

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.
(cherry picked from commit b529b60)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 21, 2025
…pythongh-132247)

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.
(cherry picked from commit b529b60)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
@bedevere-app
Copy link
bedevere-app bot commented May 21, 2025

GH-134426 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 21, 2025
@bedevere-app
Copy link
bedevere-app bot commented May 21, 2025

GH-134427 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 21, 2025
ambv pushed a commit that referenced this pull request May 21, 2025
gh-132247) (gh-134426)

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.

(cherry picked from commit b529b60)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
ambv pushed a commit that referenced this pull request May 21, 2025
gh-132247) (gh-134427)

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.
(cherry picked from commit b529b60)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
lkollar pushed a commit to lkollar/cpython that referenced this pull request May 26, 2025
…pythongh-132247)

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.
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 skip news topic-C-API
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants
0