summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-107298: Document PyMODINIT_FUNC macro (GH-109236) (#109947)Miss Islington (bot)2023-09-271-0/+24
| | | | | | | | | | | | 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 d7a27e527d7e669d2e45cff80ad725978226477c) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] Improve some C API documentation (GH-108768) (#108785)Serhiy Storchaka2023-09-023-44/+43
| | | | | | | * 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 6f97eeec222f81bd7ae836c149872a40b079e2a6)
* [3.12] Fix misc doc typos (GH-108592) (#108594)Miss Islington (bot)2023-08-292-2/+2
| | | | | | Fix misc doc typos (GH-108592) (cherry picked from commit 88f1c5b454c34efc167a94b5e2d67ec042834e5b) Co-authored-by: xzmeng <aumo@foxmail.com>
* [3.12] gh-108314: PyDict_GetItemString() mentions UTF-8 (#108448)Victor Stinner2023-08-251-3/+5
| | | | | | gh-108314: PyDict_GetItemString() mentions UTF-8 PyDict_GetItemString(), PyDict_SetItemString() and PyDict_DelItemString() expects a UTF-8 encoding string for the key.
* [3.12] gh-107298: Fix numerous ref errors and typos in the C API docs ↵Miss Islington (bot)2023-08-224-6/+18
| | | | | | | | (GH-108258) (#108284) gh-107298: Fix numerous ref errors and typos in the C API docs (GH-108258) (cherry picked from commit d7202e4879bf4e7e00a69500ddcb3143864139b4) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-107298: Fix C API datetime documentation (GH-108034). (#108234)Serhiy Storchaka2023-08-211-14/+57
| | | (cherry picked from commit d63972e289e05b0d82e59f32f107312a8b3de7b5)
* [3.12] gh-107298: Fix some references in the C API documentation (GH-108072) ↵Miss Islington (bot)2023-08-171-1/+1
| | | | | | | | (#108074) gh-107298: Fix some references in the C API documentation (GH-108072) (cherry picked from commit f51f0466c07eabc6177c2f64f70c952dada050e8) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-107298: Fix C API Buffer documentation (GH-108011). (#108048)Serhiy Storchaka2023-08-162-10/+14
| | | | | (cherry picked from commit c2941cba7a986e6158eebb2a0bf33906dcd78616) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-91051: fix segfault when using all 8 type watchers (GH-107853) ↵Miss Islington (bot)2023-08-161-2/+2
| | | | | | | | (#107876) * gh-91051: fix segfault when using all 8 type watchers (GH-107853) (cherry picked from commit 66e4edd7346b1cd65ddff6da890a0d725e325116) Co-authored-by: Carl Meyer <carl@oddbird.net>
* [3.12] Docs: Document PyBUF_MAX_NDIM (GH-107865) (#107871)Miss Islington (bot)2023-08-111-3/+7
| | | | | | Docs: Document PyBUF_MAX_NDIM (GH-107865) (cherry picked from commit 637f7ff2c60f262659da0334f1cb672bd361f398) Co-authored-by: Erlend E. Aasland <erlend@python.org>
* [3.12] gh-98154: Clarify Usage of "Reference Count" In the Docs (gh-107552) ↵Miss Islington (bot)2023-08-0813-85/+143
| | | | | | | | | | | | | | | | | | (#107752) * 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 5dc825d504ad08d64c9d1ce578f9deebbe012604) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com> * Fix a typo. --------- Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-105766: Document that Custom Allocators Must Be Thread-Safe ↵Miss Islington (bot)2023-07-311-0/+6
| | | | | | | | (gh-107519) (gh-107522) gh-105766: Document that Custom Allocators Must Be Thread-Safe (gh-107519) (cherry picked from commit db361a340af3970c279908c8746a6b9ed45f47b8) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-107306: Add a Doc Entry for Py_mod_multiple_interpreters ↵Miss Islington (bot)2023-07-312-0/+32
| | | | | | | | | | (GH-107403) (gh-107521) 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 fb344e99aa0da5bef9318684ade69978585fe060) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] Fix the documentation for PyCode_New add `qualname` parameter ↵Miss Islington (bot)2023-07-291-4/+4
| | | | | | | | (GH-107186) (#107440) Fix the documentation for PyCode_New add `qualname` parameter (GH-107186) (cherry picked from commit f2abeb590dae5918388f91b60b31f040d44218f0) Co-authored-by: da-woods <dw-git@d-woods.co.uk>
* [3.12] gh-101100: Sphinx warnings: pick the low hanging fruits (GH-107386) ↵Serhiy Storchaka2023-07-291-0/+6
| | | | | (GH-107419) (cherry picked from commit f2d07d3289947d10b065b2bb7670c8fb6b6582f2)
* [3.12] gh-107305: Update the C-API Docs for PEP 684 (gh-107324) (gh-107402)Miss Islington (bot)2023-07-281-15/+194
| | | | | | gh-107305: Update the C-API Docs for PEP 684 (gh-107324) (cherry picked from commit c0b81c4b5438a3565fadd9d6f5bc69f989a3fdee) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-107298: Fix yet more Sphinx warnings in the C API doc (GH-107345) ↵Serhiy Storchaka2023-07-2811-30/+43
| | | | | (GH-107380) (cherry picked from commit 983305268e2291b0a7835621b81bf40cba7c27f3)
* [3.12] gh-107298: Fix more Sphinx warnings in the C API doc (GH-107329) ↵Serhiy Storchaka2023-07-2816-70/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-107376) 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 8d61a71f9c81619e34d4a30b625922ebc83c561b) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-107298: Fix Sphinx warnings in the C API doc (GH-107302) (GH-107375)Serhiy Storchaka2023-07-2811-29/+29
| | | | | (cherry picked from commit 391e03fa05b80d17a14ac88d30c974fa2fa00adb) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-107298: Fix doc references to undocumented modules (GH-107300) ↵Miss Islington (bot)2023-07-284-4/+4
| | | | | | | | (GH-107370) Update also Doc/tools/.nitignore. (cherry picked from commit 87b39028e5f453a949a1675526c439f6479a04a8) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-107298: Docs: add targets for some :c:member: and :c:macro: ↵Miss Islington (bot)2023-07-272-39/+40
| | | | | | | | | | references (GH-107316) (GH-107332) Add targets for PyStructSequence_Desc and PyStructSequence_Field members and macros like Py_EQ. Fix target for Py_RETURN_RICHCOMPARE. (cherry picked from commit abec9a1b20b70d8ced401d59fc4f02b331c6568b) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-107091: Fix some uses of :attr: role (GH-107318) (GH-107330)Serhiy Storchaka2023-07-276-54/+60
| | | | | Fix also formatting of PyMethodDef members. (cherry picked from commit d363eb5b0255c055e7b43f5e2c0847f555e1982e)
* [3.12] gh-107091: Fix some uses of :c:type: role (GH-107138) (GH-107312)Miss Islington (bot)2023-07-262-10/+12
| | | | | (cherry picked from commit 6d5b6e71c87fca7c5c26f5dd8f325087962215cc) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-107091: Fix some uses of :c:member: role (GH-107129) (GH-107310)Miss Islington (bot)2023-07-265-11/+13
| | | | | (cherry picked from commit af61cb9c7837ff3c11da79e3ee1cab3fdd0ba4da) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] Fix PyVectorcall_Function doc versionadded (GH-107140) (#107173)Miss Islington (bot)2023-07-241-1/+1
| | | | | | | | | | 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 0a9b339363a59be1249189c767ed6f46fd71e1c7) Co-authored-by: da-woods <dw-git@d-woods.co.uk>
* [3.12] gh-106948: Docs: Disable links for C standard library functions, OS ↵Miss Islington (bot)2023-07-232-3/+3
| | | | | | | | utility functions and system calls (GH-107062) (#107154) (cherry picked from commit b447e19e720e6781025432a40eb72b1cc93ac944) Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-107091: Fix the use of some C domain roles (GH-107092) (GH-107113)Miss Islington (bot)2023-07-235-8/+8
| | | | | (cherry picked from commit 08a228da05a7aec937b65eea21f4091fa3c6b5cf) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-101100: Fix some broken sphinx references (GH-107095) (#107103)Miss Islington (bot)2023-07-234-6/+6
| | | | | (cherry picked from commit f5147c0cfbd7943ff10917225448c36a53f9828d) Co-authored-by: wulmer <wulmer@users.noreply.github.com>
* [3.12] gh-106948: Add standard external names to nitpick_ignore (GH-106949) ↵Serhiy Storchaka2023-07-234-14/+14
| | | | | | | | | | | | | | (#107060) * [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 f8b7fe2f2647813ae8249675a80e59c117d30fe1) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * Delete 2023-05-31-18-37-57.gh-issue-105156.R4El5V.rst
* [3.12] gh-106892: Use roles :data: and :const: for referencing module ↵Serhiy Storchaka2023-07-211-3/+3
| | | | | variables (GH-106894) (GH-106954) (cherry picked from commit d036db728ea3d54509cbad06df74e2d9a31fbec8)
* [3.12] gh-106909: Use role :const: for referencing module constants ↵Serhiy Storchaka2023-07-211-1/+1
| | | | | (GH-106910) (GH-106956) (cherry picked from commit 4b9948617f91175783609769aa6160e5b49b9ccc)
* [3.12] gh-106919: Use role :c:macro: for referencing the C "constants" ↵Serhiy Storchaka2023-07-2120-210/+228
| | | | | (GH-106920) (GH-106951) (cherry picked from commit fcc816dbff7ca66c26f57a506e4d2330fe41d0ff)
* [3.12] gh-105227: Add PyType_GetDict() (GH-105747) (#106600)Miss Islington (bot)2023-07-102-1/+30
| | | | | | | | | | gh-105227: Add PyType_GetDict() (GH-105747) This compensates for static builtin types having `tp_dict` set to `NULL`. (cherry picked from commit a840806d338805fe74a9de01081d30da7605a29f) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.12] tp_flags docs: fix indentation (GH-106420) (#106442)Miss Islington (bot)2023-07-051-9/+9
| | | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* [3.12] gh-101100: Docs: Fix references to several numeric dunders ↵Miss Islington (bot)2023-06-303-26/+26
| | | | | | | | | (GH-106278) (#106281) gh-101100: Docs: Fix references to several numeric dunders (GH-106278) (cherry picked from commit a8ae73965b02302b7661ea07a6e4f955a961aca9) Co-authored-by: F3eQnxN3RriK <drsuaimqjgar@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-84436: update docs on Py_None/Py_True/Py_False/Py_Ellipsis ↵Miss Islington (bot)2023-06-263-19/+25
| | | | | | | | becoming immortal (GH-105195) (#105977) gh-84436: update docs on Py_None/Py_True/Py_False/Py_Ellipsis becoming immortal (GH-105195) (cherry picked from commit a2392720d6108041d17960a86514ba859b436f05) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.12] gh-106033: [docs] Improve C API GetItem & HasAttr notes. (GH-106047) ↵Miss Islington (bot)2023-06-242-14/+23
| | | | | | | | | | | | (#106070) 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 19d6511b0b8f3f74e668ae32ccef89bcbf1a8a62) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* [3.12] gh-105196: Fix indentations of section headings in C API docs ↵Miss Islington (bot)2023-06-153-6/+6
| | | | | | | | (GH-105672) (#105782) gh-105196: Fix indentations of section headings in C API docs (GH-105672) (cherry picked from commit d32e8d6070057eb7ad0eb2f9d9f1efab38b2cff4) Co-authored-by: TATHAGATA ROY <royzen9495@gmail.com>
* [3.12] gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL ↵Miss Islington (bot)2023-06-121-1/+1
| | | | | | | | (GH-105386) (GH-105697) gh-103968: PyType_FromMetaclass: Allow metaclasses with tp_new=NULL (GH-105386) (cherry picked from commit 2b90796be6959d5ef46b38c434a514fce25be971) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.12] gh-102304: doc: Add links to Stable ABI and Limited C API (#105345) ↵Victor Stinner2023-06-066-28/+41
| | | | | | | | | | | | | | | | | | | (#105371) * gh-102304: doc: Add links to Stable ABI and Limited C API (#105345) * Add "limited-c-api" and "stable-api" references. * Rename "stable-abi-list" reference to "limited-api-list". * Makefile: Document files regenerated by "make regen-limited-abi" * Remove first empty line in generated files: - Lib/test/test_stable_abi_ctypes.py - PC/python3dll.c (cherry picked from commit bae415ad02c79cf3a2eec4aa6969221a12e6716f) * gh-102304: Fix up Simple ABI doc (GH-105351) (cherry picked from commit 0202aa002e06acef9aa55ace0d939103df19cadd)
* [3.12] gh-97908: CAPI docs: Remove repeated struct names from member docs ↵Miss Islington (bot)2023-06-052-8/+23
| | | | | | | | (GH-100054) (#105057) And add raw HTML fragments to keep old links working. (cherry picked from commit 1668b41dc477bc9562e4c50ab36a232839b4621b) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.12] gh-102778: update documentation of PyErr_PrintEx and ↵Miss Islington (bot)2023-06-021-3/+8
| | | | | | | | traceback.print_last() regarding sys.last_exc (GH-105190) (#105246) gh-102778: update documentation of PyErr_PrintEx and traceback.print_last() regarding sys.last_exc (GH-105190) (cherry picked from commit 0dafc785ee6629dbcb9bec6f7aee43a56cd0b26e) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.12] gh-105184: document that marshal functions can fail and need to be ↵Miss Islington (bot)2023-06-021-0/+4
| | | | | | | | checked with PyErr_Occurred (GH-105185) (#105218) gh-105184: document that marshal functions can fail and need to be checked with PyErr_Occurred (GH-105185) (cherry picked from commit ee26ca13a129da8cf549409d0a1b2e892ff2b4ec) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.12] gh-105071: add missing versionadded directive (GH-105097) (#105105)Miss Islington (bot)2023-05-301-0/+2
| | | | | | gh-105071: add missing versionadded directive (GH-105097) (cherry picked from commit 4571eedca2f70768ddc4a2fd4fba2ae11b4c8037) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* [3.12] gh-105071: add PyUnstable_Exc_PrepReraiseStar to expose except* ↵Irit Katriel2023-05-301-0/+10
| | | | | implementation in the unstable API (GH-105072) (#105095) (cherry picked from commit b7aadb4583b040ddc8564896b91f4e5e571c82d6)
* [3.12] GH-104668: Don't call PyOS_* hooks in subinterpreters (GH-104760)Miss Islington (bot)2023-05-231-0/+8
| | | | | | GH-104668: Don't call PyOS_* hooks in subinterpreters (GH-104674) (cherry picked from commit 357bed0bcd3c5d7c4a8caad451754a9a172aca3e) Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
* gh-98836: Extend PyUnicode_FromFormat() (GH-98838)Serhiy Storchaka2023-05-211-85/+143
| | | | | | | | | * Support for conversion specifiers o (octal) and X (uppercase hexadecimal). * Support for length modifiers j (intmax_t) and t (ptrdiff_t). * Length modifiers are now applied to all integer conversions. * Support for wchar_t C strings (%ls and %lV). * Support for variable width and precision (*). * Support for flag - (left alignment).
* GH-101291: Add low level, unstable API for pylong (GH-101685)Mark Shannon2023-05-211-0/+24
| | | Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-103295: expose API for writing perf map files (#103546)gsallam2023-05-212-0/+51
| | | | | Co-authored-by: Aniket Panse <aniketpanse@fb.com> Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Carl Meyer <carl@oddbird.net>
* GH-96803: Document and test new unstable internal frame API functions ↵Mark Shannon2023-05-181-0/+35
| | | | | | (GH-104211) Weaken contract of PyUnstable_InterpreterFrame_GetCode to return PyObject*.