gh-116935: Document that heap types need to support garbage collection (GH-118021)
(cherry picked from commit 5d54436574)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
gh-117518: Clarify PyTuple_GetItem() borrowed reference in the doc (GH-117920)
(cherry picked from commit 4605a197bd)
Co-authored-by: Victor Stinner <vstinner@python.org>
closure is not a function pointer, it is a user data pointer.
(cherry picked from commit df59401108)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-115653: Document PyCode_GetFirstFree() (GH-115654)
Correct the return type of the PyCode_GetNumFree() documentation.
(cherry picked from commit 10fc4675fd)
Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-112092: clarify unstable ABI recompilation requirements (GH-112093)
Use different versions in the examples for when extensions do and do not need to be recompiled to make the examples easier to understand.
(cherry picked from commit 68a7b78cd5)
Co-authored-by: DerSchinken <53398996+DerSchinken@users.noreply.github.com>
gh-102468: Document `PyCFunction_New*` and `PyCMethod_New` (GH-112557)
(cherry picked from commit a482bc67ee)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
gh-101578: [doc] mention that PyErr_GetRaisedException returns NULL when the error indicator is not set (GH-113369)
(cherry picked from commit 2849cbb53a)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
gh-101100: Further improve docs on function attributes (GH-113001)
(cherry picked from commit 81a15ea74e)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
gh-111178: Docs: fix `traverseproc`, `inquiry`, and `destructor` parameters in slot typedefs table (GH-112742)
In the slot typedefs table, the parameter of `destructor`
and the first parameter of `traverseproc` should both be
`PyObject *` rather than `void *`.
Same for `inquiry`.
(cherry picked from commit 00cce0fe49)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
Standardize PyUnicode C API parameter names across the documentation.
(cherry picked from commit b31232ddf7)
Co-authored-by: Rune Tynan <runetynan@gmail.com>
C-API docs: Clarify the size of arenas (GH-110895)
Clarify the size of arenas
From 3.10.0 alpha 7, the pymalloc allocator uses arenas with a fixed size of 1
MiB on 64-bit platforms instead of 256 KiB on 32-bit platforms.
(cherry picked from commit f07ca27709)
Co-authored-by: Mienxiu <82512658+mienxiu@users.noreply.github.com>
gh-110803: Reorganize docs for what PyType_Slot doesn't cover (GH-110813)
* gh-110803: Reorganize docs for what PyType_Slot doesn't cover
- Cover the offset fields first
- Mention the old alternative for MANAGED flags, which is needed
to support older Pythons
- De-emphasize the internal flags: use an inline list.
- Add a note to PyMemberDef saying what to do with it
* Remove an older draft...
(cherry picked from commit 2ab34f0e42)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-107298: Document PyMODINIT_FUNC macro (GH-109236)
Document PyMODINIT_FUNC macro.
Remove links to PyAPI_FUNC() and PyAPI_DATA() macros since they are
not documented. These macros should only be used to define the Python
C API. They should not be used outside Python code base.
(cherry picked from commit d7a27e527d)
Co-authored-by: Victor Stinner <vstinner@python.org>
* Express functions which take argument as a C string in terms of
functions which take Python object.
* Use "note" directive for PyMapping_HasKey() and
PyMapping_HasKeyString() notes..
(cherry picked from commit 6f97eeec22)
gh-108314: PyDict_GetItemString() mentions UTF-8
PyDict_GetItemString(), PyDict_SetItemString() and
PyDict_DelItemString() expects a UTF-8 encoding string for the key.
gh-107298: Fix numerous ref errors and typos in the C API docs (GH-108258)
(cherry picked from commit d7202e4879)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-107298: Fix some references in the C API documentation (GH-108072)
(cherry picked from commit f51f0466c0)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>