Skip to content

gh-132177: Correct ctypes _objects ownership documentation - #159837

Open
limadog9 wants to merge 1 commit into
python:mainfrom
limadog9:gh-132177-ctypes-objects-docs
Open

limadog9 wants to merge 1 commit into
python:mainfrom
limadog9:gh-132177-ctypes-objects-docs

Conversation

@limadog9

@limadog9 limadog9 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Correct the description of ctypes._CData._objects: it can hold an object other than None or a dictionary. Use the memoryview retained by from_buffer() as a concrete example, while keeping the existing debugging-only guidance.

Fixes #132177.

Validation:

  • Confirmed None, dictionary, and memoryview ownership cases on a current CPython debug build, including shared-buffer mutation and the memoryview's reference to its source buffer.
  • Full HTML documentation build with warnings treated as errors.
  • Sphinx lint and patchcheck.

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35258516 | 📁 Comparing 51665ac against main (0fba211)

  🔍 Preview build  

1 file changed
± library/ctypes.html

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.

_objects attribute of ctypes data instances is sometimes not None or a dictionary

1 participant