SIGN IN SIGN UP

[3.13] gh-129675: Update documentation for tp_basicsize & tp_itemsize (GH-129850) (GH-131079)

- 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
- suggest Py_SIZE & Py_SET_SIZE

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.

(cherry picked from commit ad0f618ab3eb1f26f8830a863aaf7bb70835c00d)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
M
Miss Islington (bot) committed
6ceb8fcfb69bad6c5521db475b7e0a2455432b12
Parent: 6af54d2
Committed by GitHub <noreply@github.com> on 3/17/2025, 3:18:26 PM