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

[3.12] gh-129675: Update documentation for tp_basicsize & tp_itemsize (GH-129850) by miss-islington · Pull Request #131078 · python/cpython · GitHub

Repository navigation

[3.12] gh-129675: Update documentation for tp_basicsize & tp_itemsize (GH-129850) - #131078

Merged
encukou merged 1 commit into
python:3.12from
miss-islington:backport-ad0f618-3.12
Mar 17, 2025
Merged

encukou merged 1 commit into
python:3.12from
miss-islington:backport-ad0f618-3.12

Conversation

miss-islington commented Mar 11, 2025 •
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Contributor
  • Update documentation for tp_basicsize & tp_itemsize
  • Add alignment requirement
  • Mention that ob_size is unreliable if you don't control it
  • Add some links for context
  • basicsize should include the base type in generaly not just PyObject

This adds a “by-the-way” link to PyObject_New, which shouldn't be
used for GC types. In order to be comfortable linking to it, I also
add a link to PyObject_GC_New from its docs. And the same for
*Var variants, while I'm here.

  • Strongly suggest Py_SIZE & Py_SET_SIZE
    (cherry picked from commit ad0f618)

Co-authored-by: Petr Viktorin encukou@gmail.com


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

…ythonGH-129850)

* Update documentation for tp_basicsize & tp_itemsize

- Add alignment requirement
- Mention that ob_size is unreliable if you don't control it
- Add some links for context
- basicsize should include the base type in generaly not just PyObject

This adds a “by-the-way” link to `PyObject_New`, which shouldn't be
used for GC types. In order to be comfortable linking to it, I also
add a link to `PyObject_GC_New` from its docs. And the same for
`*Var` variants, while I'm here.

* Strongly suggest Py_SIZE & Py_SET_SIZE
(cherry picked from commit ad0f618)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
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

docs Documentation in the Doc dir skip news topic-C-API

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL