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>
Fix PyVectorcall_Function doc versionadded (GH-107140)
The documentation implies that PyVectorcall_Function() was available in Python 3.8.
This is half-true - it was available under a different name. I think it's clearer to set
the "version added" to 3.9.
(cherry picked from commit 0a9b339363)
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
* [3.12] gh-106948: Add standard external names to nitpick_ignore (GH-106949)
It includes standard C types, macros and variables like "size_t",
"LONG_MAX" and "errno", and standard environment variables like "PATH".
(cherry picked from commit f8b7fe2f26)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Delete 2023-05-31-18-37-57.gh-issue-105156.R4El5V.rst
gh-105227: Add PyType_GetDict() (GH-105747)
This compensates for static builtin types having `tp_dict` set to `NULL`.
(cherry picked from commit a840806d33)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-106033: [docs] Improve C API GetItem & HasAttr notes. (GH-106047)
Use a note:: tag so that these dict and object API deficiencies show up clearly.
A caution:: tag was considered, but our current python docs rendering doesn't do much with that (no box or color change). warning:: seemed too extreme. note looks good.
(cherry picked from commit 19d6511b0b)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-105196: Fix indentations of section headings in C API docs (GH-105672)
(cherry picked from commit d32e8d6070)
Co-authored-by: TATHAGATA ROY <royzen9495@gmail.com>