SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

0 0 0 Python

gh-129675: Update documentation for tp_basicsize & tp_itemsize (#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
P
Petr Viktorin committed
ad0f618ab3eb1f26f8830a863aaf7bb70835c00d
Parent: faadb44
Committed by GitHub <[email protected]> on 3/11/2025, 10:21:18 AM