FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-148431: Clarify format and item size in buffer requests by limadog9 · Pull Request #159832 · python/cpython · GitHub

Repository navigation

gh-148431: Clarify format and item size in buffer requests - #159832

Open
limadog9 wants to merge 1 commit into
python:mainfrom
limadog9:gh-148431-buffer-format-docs
Open

limadog9 wants to merge 1 commit into
python:mainfrom
limadog9:gh-148431-buffer-format-docs

Conversation

limadog9 commented Oct 20, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

Fixes #148431.

Clarify that a NULL Py_buffer.format does not imply that the original elements have size one when shape information is present. Explain that PyBUF_FORMAT is optional for structured requests and must be combined with PyBUF_ND or a flag that includes it, rather than used alone or only with PyBUF_WRITABLE.

Validation: the full Sphinx HTML build passed with warnings treated as errors; sphinx-lint and git diff --check passed. Verified the described behavior with a non-byte memoryview and _testbuffer.ndarray, covering PyBUF_ND, PyBUF_STRIDED_RO, PyBUF_SIMPLE, and format requests with and without shape information.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35258028 | 📁 Comparing 9c8ed60 against main (0fba211)

  🔍 Preview build  

1 file changed
± c-api/buffer.html

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

Buffer requests - itemsize, format, and PyBUF_SIMPLE

1 participant


Back | FazBrowse Home | New Git URL