Skip to content

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

Merged
ambv merged 3 commits into
python:mainfrom
cmaloney:doc_getbuffer_release
May 21, 2025
Merged

gh-132246: Add special buffer methods to C API Type Object docs#132247
ambv merged 3 commits into
python:mainfrom
cmaloney:doc_getbuffer_release

Conversation

@cmaloney

@cmaloney cmaloney commented Apr 7, 2025

Copy link
Copy Markdown
Contributor

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.
Comment thread Doc/c-api/typeobj.rst Outdated
@ZeroIntensity ZeroIntensity added the needs backport to 3.13 bugs and security fixes label Apr 21, 2025

@ZeroIntensity ZeroIntensity left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Contributor Author

cc: @gpshead

@ambv ambv merged commit b529b60 into python:main May 21, 2025
2 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
Copy Markdown

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

bedevere-app Bot commented May 21, 2025

Copy link
Copy Markdown

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

bedevere-app Bot commented May 21, 2025

Copy link
Copy Markdown

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.
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 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.
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 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.
gostak-dd pushed a commit to gostak-dd/cpython that referenced this pull request Jun 2, 2026
…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