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>
* gh-91051: fix segfault when using all 8 type watchers (GH-107853)
(cherry picked from commit 66e4edd734)
Co-authored-by: Carl Meyer <carl@oddbird.net>
* gh-98154: Clarify Usage of "Reference Count" In the Docs (gh-107552)
PEP 683 (immortal objects) revealed some ways in which the Python documentation has been unnecessarily coupled to the implementation details of reference counts. In the end users should focus on reference ownership, including taking references and releasing them, rather than on how many reference counts an object has.
This change updates the documentation to reflect that perspective. It also updates the docs relative to immortal objects in a handful of places.
(cherry picked from commit 5dc825d504)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* Fix a typo.
---------
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
gh-105766: Document that Custom Allocators Must Be Thread-Safe (gh-107519)
(cherry picked from commit db361a340a)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters (GH-107403)
It was added in 3.12 for PEP 684 (per-interpreter GIL).
(cherry picked from commit fb344e99aa)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
gh-107305: Update the C-API Docs for PEP 684 (gh-107324)
(cherry picked from commit c0b81c4b54)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Declare the following functions as macros, since they are actually
macros. It avoids a warning on "TYPE" or "macro" argument.
* PyMem_New()
* PyMem_Resize()
* PyModule_AddIntMacro()
* PyModule_AddStringMacro()
* PyObject_GC_New()
* PyObject_GC_NewVar()
* PyObject_New()
* PyObject_NewVar()
Add C standard C types to nitpick_ignore in Doc/conf.py:
* int64_t
* uint64_t
* uintptr_t
No longer ignore non existing "__int" type in nitpick_ignore.
Update Doc/tools/.nitignore.
(cherry picked from commit 8d61a71f9c)
Co-authored-by: Victor Stinner <vstinner@python.org>
Add targets for PyStructSequence_Desc and PyStructSequence_Field members
and macros like Py_EQ.
Fix target for Py_RETURN_RICHCOMPARE.
(cherry picked from commit abec9a1b20)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>