summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-101944: Clarify PyModule_AddObjectRef() documentation (GH-129433) ↵Miss Islington (bot)2025-02-031-3/+4
| | | | | | | | (#129613) gh-101944: Clarify PyModule_AddObjectRef() documentation (GH-129433) (cherry picked from commit 04264a286e5ddfe8ac7423f7376ca34a2ca8b7ba) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] Docs C API: Clarify what happens when null bytes are passed to ↵Miss Islington (bot)2025-01-201-0/+9
| | | | | | | | | | | `PyUnicode_AsUTF8` (GH-127458) (#129081) Docs C API: Clarify what happens when null bytes are passed to `PyUnicode_AsUTF8` (GH-127458) (cherry picked from commit e792f4bc2e712bb6e2143599d2b88dd339de83e6) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Stan U. <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Tomas R. <tomas.roun8@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-90241: Clarify documentation for PyUnicode_FSConverter and ↵Miss Islington (bot)2025-01-062-11/+36
| | | | | | | | | PyUnicode_FSDecoder (GH-128451) (GH-128543) (cherry picked from commit 657d7b77e5c69967e9c0000b986fa4872d13958c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.12] gh-77214: Update outdated documentation for numeric PyArg_Parse ↵Miss Islington (bot)2025-01-061-8/+14
| | | | | | | formats (GH-128454) (GH-128539) (cherry picked from commit 8d15058d61681e98579cf3fbd3c6fd13b3df6a72) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-127954: Document PyObject_DelItemString (GH-127986) (#128497)Miss Islington (bot)2025-01-041-0/+7
| | | | | (cherry picked from commit 8ade15343d5daec3bf79ff7c47f03726fb2bcadf) Co-authored-by: RUANG (James Roy) <rruuaanng@outlook.com>
* [3.12] gh-125674: Doc: Fix type of newfunc first parameter (GH-125675) (#128448)Miss Islington (bot)2025-01-031-2/+2
| | | | | | (cherry picked from commit 616468b87bc5bcf5a4db688637ef748e1243db8a) Co-authored-by: Richard Hansen <rhansen@rhansen.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* [3.12] Document PyObject_SelfIter (GH-127861) (#127899)Miss Islington (bot)2024-12-131-0/+6
| | | | | | Document PyObject_SelfIter (GH-127861) (cherry picked from commit 58942a07df8811afba9c58dc16c1aab244ccf27a) Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* [3.12] gh-127253: Note that Stable ABI is about ABI stability (GH-127254) ↵Miss Islington (bot)2024-12-031-3/+11
| | | | | | | (GH-127558) (cherry picked from commit 35d37d6592d1be71ea76042165f6cbfa6c4c3a17) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.12] Docs: Fix incorrect indents in `c-api/type.rst` (GH-127449) (#127461)Yuki Kobayashi2024-12-011-20/+19
| | | (cherry picked from commit 33ce8dcf791721fea563715f681dc1593a35b83b)
* [3.12] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code ↵Miss Islington (bot)2024-11-231-1/+5
| | | | | | | | (GH-126667) (#127202) Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (cherry picked from commit e3038e976b25a58f512d8c7083a752c89436eb0d) Co-authored-by: Richard Hansen <rhansen@rhansen.org>
* [3.12] Doc: C API: Demote sections to subsections for consistency ↵Miss Islington (bot)2024-11-071-7/+7
| | | | | | | | | | | (GH-126535) (#126545) Doc: C API: Demote sections to subsections for consistency (GH-126535) The entire file should be a single section; the headings below the first heading should be subsections. (cherry picked from commit e3510bd3dd9ea8f2a30cb1128470aee3a48d8880) Co-authored-by: Richard Hansen <rhansen@rhansen.org>
* [3.12] Doc: C API: Delete claim that `PyObject_Init` is GC-aware (GH-126418) ↵Miss Islington (bot)2024-11-051-4/+2
| | | | | | | | (#126432) Doc: C API: Delete claim that `PyObject_Init` is GC-aware (GH-126418) (cherry picked from commit 407c0366d9ccd2a36c6cc8bf92324856b16fd604) Co-authored-by: Richard Hansen <rhansen@rhansen.org>
* [3.12] gh-123609: Clarify usage of standalone `PyBUF_FORMAT` (GH-123778) ↵Miss Islington (bot)2024-11-011-4/+5
| | | | | | | | (GH-123904) gh-123609: Clarify usage of standalone `PyBUF_FORMAT` (GH-123778) (cherry picked from commit 962304a54ca79da0838cf46dd4fb744045167cdd) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.12] Doc: C API: Move `tp_dealloc` paragraph to `tp_dealloc` section ↵Miss Islington (bot)2024-10-211-11/+13
| | | | | | | | | | | | | | (GH-125737) (#125799) Doc: C API: Move `tp_dealloc` paragraph to `tp_dealloc` section (GH-125737) It looks like commit 43cf44ddcce6b225f959ea2a53e4817244ca6054 (gh-31501) accidentally moved the paragraph to the `tp_finalize` section when the intent was to move it to the `tp_dealloc` section (according to the commit message). (cherry picked from commit d880c83ff7fb2e464bc4f469d74cc3fc3eca082c) Co-authored-by: Richard Hansen <rhansen@rhansen.org>
* [3.12] gh-101291: Add versionadded directives for PyUnstable_Long_* ↵Miss Islington (bot)2024-10-131-0/+5
| | | | | | | | (GH-125384) (#125408) gh-101291: Add versionadded directives for PyUnstable_Long_* (GH-125384) (cherry picked from commit c6d7b644c2425b397cfb641f336bea70eb8a329a) Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
* [3.12] gh-101100: Consolidate documentation on `ModuleType` attributes ↵Alex Waygood2024-10-092-23/+25
| | | | | | | | (#124709) (#125211) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Barry Warsaw <barry@python.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* [3.12] gh-124182: Explain naming rules for struct sequence types (GH-124335) ↵Miss Islington (bot)2024-10-071-1/+2
| | | | | | | | (#125056) gh-124182: Explain naming rules for struct sequence types (GH-124335) (cherry picked from commit 3287c834e5370294e310450115290979aac06efa) Co-authored-by: ffelixg <142172984+ffelixg@users.noreply.github.com>
* [3.12] gh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` ↵Miss Islington (bot)2024-10-031-1/+1
| | | | | | | | (gh-124920) (gh-124931) gh-115145: Update documentation about ``PyThreadState_DeleteCurrent`` (gh-124920) (cherry picked from commit 9eeb21bf761070649bf8d78976a62dabb6d67a99) Co-authored-by: Donghee Na <donghee.na@python.org>
* [3.12] Fix `c-api/file.rst` indexes (GH-114608) (#124786)sobolevn2024-09-301-2/+3
| | | (cherry picked from commit 23fb9f0777b054526b3b32f58e60b2a03132bf45)
* [3.12] gh-113993: Make interned strings mortal (GH-120520, GH-121364, ↵Petr Viktorin2024-09-273-6/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GH-121903, GH-122303) (#123065) This backports several PRs for gh-113993, making interned strings mortal so they can be garbage-collected when no longer needed. * Allow interned strings to be mortal, and fix related issues (GH-120520) * Add an InternalDocs file describing how interning should work and how to use it. * Add internal functions to *explicitly* request what kind of interning is done: - `_PyUnicode_InternMortal` - `_PyUnicode_InternImmortal` - `_PyUnicode_InternStatic` * Switch uses of `PyUnicode_InternInPlace` to those. * Disallow using `_Py_SetImmortal` on strings directly. You should use `_PyUnicode_InternImmortal` instead: - Strings should be interned before immortalization, otherwise you're possibly interning a immortalizing copy. - `_Py_SetImmortal` doesn't handle the `SSTATE_INTERNED_MORTAL` to `SSTATE_INTERNED_IMMORTAL` update, and those flags can't be changed in backports, as they are now part of public API and version-specific ABI. * Add private `_only_immortal` argument for `sys.getunicodeinternedsize`, used in refleak test machinery. Make sure the statically allocated string singletons are unique. This means these sets are now disjoint: - `_Py_ID` - `_Py_STR` (including the empty string) - one-character latin-1 singletons Now, when you intern a singleton, that exact singleton will be interned. * Add a `_Py_LATIN1_CHR` macro, use it instead of `_Py_ID`/`_Py_STR` for one-character latin-1 singletons everywhere (including Clinic). * Intern `_Py_STR` singletons at startup. * Beef up the tests. Cover internal details (marked with `@cpython_only`). * Add lots of assertions * Don't immortalize in PyUnicode_InternInPlace; keep immortalizing in other API (GH-121364) * Switch PyUnicode_InternInPlace to _PyUnicode_InternMortal, clarify docs * Document immortality in some functions that take `const char *` This is PyUnicode_InternFromString; PyDict_SetItemString, PyObject_SetAttrString; PyObject_DelAttrString; PyUnicode_InternFromString; and the PyModule_Add convenience functions. Always point out a non-immortalizing alternative. * Don't immortalize user-provided attr names in _ctypes * Immortalize names in code objects to avoid crash (GH-121903) * Intern latin-1 one-byte strings at startup (GH-122303) There are some 3.12-specific changes, mainly to allow statically allocated strings in deepfreeze. (In 3.13, deepfreeze switched to the general `_Py_ID`/`_Py_STR`.) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] GH-95079: document error behaviour for some unicode C APIs (GH-95080) ↵Miss Islington (bot)2024-09-271-0/+9
| | | | | | | (#124662) (cherry picked from commit b79a21ea429844e84509430e636d808ea9cff244) Co-authored-by: Max Bachmann <kontakt@maxbachmann.de>
* [3.12] gh-101100: Add a table of class attributes to the "Custom classes" ↵Alex Waygood2024-09-254-18/+20
| | | | section of the data model docs (#124480) (#124558)
* [3.12] Use pep role instead of url (GH-121611) (#124173)Miss Islington (bot)2024-09-172-4/+4
| | | | Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
* [3.12] Swap the and from in sentence in init_config.rst (GH-120086) (#123743)Miss Islington (bot)2024-09-051-1/+1
| | | | Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
* [3.12] gh-123517: Remove unnecessary `:meth:` parentheses (gh-123518) ↵Wei-Hsiang (Matt) Wang2024-09-021-2/+2
| | | | (GH-123576)
* [3.12] gh-123492: Remove unnecessary `:func:` parentheses (gh-123493) (#123512)Wei-Hsiang (Matt) Wang2024-08-302-2/+2
|
* [3.12] gh-123254: Improve `tuple` C API docs with more info about errors ↵Miss Islington (bot)2024-08-281-8/+16
| | | | | | | | | (GH-123255) (#123415) gh-123254: Improve `tuple` C API docs with more info about errors (GH-123255) (cherry picked from commit 6f563e364d1a7902417573f842019746a79cdc1b) Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.12] gh-122613: Document PyLong_GetInfo() (part of Limited API) ↵Sergey B Kirpichev2024-08-051-0/+11
| | | | | | (GH-122280) (#122644) [3.12] gh-122613: Document PyLong_GetInfo() (part of Limited API) (GH-GH-122280) (cherry picked from commit d91ac525ef166edc0083acf5a96f81b87324fe7f)
* [3.12] gh-122623: Improve `c-api/bytearray.rst` with error handling info ↵Miss Islington (bot)2024-08-031-2/+7
| | | | | | | | (GH-122624) (#122659) gh-122623: Improve `c-api/bytearray.rst` with error handling info (GH-122624) (cherry picked from commit 151934a324789c58cca9c7bbd6753d735454df5a) Co-authored-by: sobolevn <mail@sobolevn.me>
* [3.12] Docs: spelling and grammar fixes (GH-122084) (#122107)Russell Keith-Magee2024-07-221-2/+2
| | | | | | (cherry picked from commit bc264eac3ad14dab748e33b3d714c2674872791f) Co-authored-by: Ville Skyttä <ville.skytta@iki.fi> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* [3.12] GH-121970: Rewrite the C-API annotations extension (GH-121985) (#122025)Adam Turner2024-07-191-2/+4
| | | | | (cherry picked from commit 22c9d9c1fcc3bb6186524330b169eda6df450f1b) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.12] gh-121905: Consistently use "floating-point" instead of "floating ↵Serhiy Storchaka2024-07-194-14/+14
| | | | | point" (GH-121907) (GH-122013) (cherry picked from commit 1a0c7b9ba48a2dffb70bb0c7327abae1d3e87356)
* [3.12] gh-121834: Improve `complex` C-API docs (GH-121835) (#121897)sobolevn2024-07-171-6/+18
| | | | | | | | * [3.12] gh-121834: Improve `complex` C-API docs (GH-121835) (cherry picked from commit 72dccd60735b597e99c007a7b69210763a746877) Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.12] gh-121749: Fix discrepancy in docs for `PyModule_AddObjectRef` ↵Miss Islington (bot)2024-07-141-1/+1
| | | | | | | (GH-121750) (GH-121753) (cherry picked from commit 26dfb2771236bfd96cdaa1081103f75141ecff47) Co-authored-by: Dominic H <dom@dominic.sk>
* [3.12] gh-121615: Improve `module.rst` C-API docs with better error ↵sobolevn2024-07-111-7/+14
| | | | | descriptions (GH-121616) (#121619) (cherry picked from commit e6264b44dc7221c713b14dfa0f5929b33d362829)
* [3.12] gh-121567: Improve `slice` C-API docs by mentioning exceptions ↵Miss Islington (bot)2024-07-101-3/+5
| | | | | | | | | (GH-121568) (#121579) gh-121567: Improve `slice` C-API docs by mentioning exceptions (GH-121568) (cherry picked from commit 84a5597b08b7d53aced2fbd0048271ce762807a8) Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* [3.12] gh-121533: Improve `PyCell_[Get,Set]` docs: mention the exceptions ↵Miss Islington (bot)2024-07-091-3/+6
| | | | | | | | | (GH-121534) (#121540) gh-121533: Improve `PyCell_[Get,Set]` docs: mention the exceptions (GH-121534) (cherry picked from commit 649d5b6d7b04607dd17810ac73e8f16720c6dc78) Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] docs: Fix "Py_TPFLAGS_MANAGED_WEAKREF is set in tp_flags" (GH-112237) ↵Miss Islington (bot)2024-07-031-2/+2
| | | | | | | | (#121310) docs: Fix "Py_TPFLAGS_MANAGED_WEAKREF is set in tp_flags" (GH-112237) (cherry picked from commit 4232976b02cb999335c6bfdec3315520b21954f2) Co-authored-by: da-woods <dw-git@d-woods.co.uk>
* [3.12] gh-120838: Add a Note in the Docs About Expectations for ↵Miss Islington (bot)2024-06-211-3/+10
| | | | | | | Py_Finalize() (gh-120853) (cherry picked from commit 03fa2df92707b543c304a426732214002f81d671, AKA gh-120839) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* [3.12] gh-119467: Fix Py_buffer.format type and correct documentation typo ↵Miss Islington (bot)2024-05-271-2/+2
| | | | | | | | (GH-119475) (#119603) gh-119467: Fix Py_buffer.format type and correct documentation typo (GH-119475) (cherry picked from commit 3b26cd8ca0e6c65e4b61effea9aa44d06e926797) Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
* [3.12] docs: fix a few typos identified by codespell (GH-119516) (#119571)Hugo van Kemenade2024-05-261-2/+2
| | | | Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* [3.12] Format None, True, False and NotImplemented as literals (GH-118758) ↵Serhiy Storchaka2024-05-081-1/+1
| | | | | (GH-118794) (cherry picked from commit 05c2fe1acda9ea5a57061642c36e8b73bb4fbba4)
* [3.12] gh-116935: Document that heap types need to support garbage ↵Miss Islington (bot)2024-04-191-1/+2
| | | | | | | | collection (GH-118021) (GH-118092) gh-116935: Document that heap types need to support garbage collection (GH-118021) (cherry picked from commit 5d544365742a117027747306e2d4473f3b73d921) Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
* [3.12] gh-117518: Clarify PyTuple_GetItem() borrowed reference in the doc ↵Miss Islington (bot)2024-04-191-0/+6
| | | | | | | | (GH-117920) (#118087) gh-117518: Clarify PyTuple_GetItem() borrowed reference in the doc (GH-117920) (cherry picked from commit 4605a197bd84da1a232bd835d8e8e654f2fef220) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.12] gh-73231: Update documentation for PyErr_SetFromWindowsErr() ↵Miss Islington (bot)2024-04-171-4/+5
| | | | | | | (GH-117226) (GH-117973) (cherry picked from commit 438b7c3071eebaccd1ba215f15a239345b22f813) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] Docs: add link roles with Sphinx extlinks (GH-117850) (#117910)Hugo van Kemenade2024-04-151-1/+1
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.12] gh-115664: Fix ordering of more versionadded and versionchanged ↵Serhiy Storchaka2024-03-074-8/+8
| | | | | directives (GH-116298) (GH-116450) (cherry picked from commit 808a77612fb89b125d25efac2788522a100e8a6d)
* [3.12] Fix the PyGetSetDef documentation (GH-116056) (GH-116363)Miss Islington (bot)2024-03-051-3/+3
| | | | | | closure is not a function pointer, it is a user data pointer. (cherry picked from commit df594011089a83d151ac7000954665536f3461b5) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-115653: Document PyCode_GetFirstFree() (GH-115654) (#115752)Miss Islington (bot)2024-02-211-2/+6
| | | | | | | | gh-115653: Document PyCode_GetFirstFree() (GH-115654) Correct the return type of the PyCode_GetNumFree() documentation. (cherry picked from commit 10fc4675fdb14e19f2fdd15102c6533b9f71e992) Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
* [3.12] gh-101100: Fix Sphinx warnings in `whatsnew/3.2.rst` (GH-115580) ↵Miss Islington (bot)2024-02-172-0/+52
| | | | | | | (#115589) Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>