summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
Commit message (Collapse)AuthorAgeFilesLines
* Python 3.13.3v3.13.3Thomas Wouters2025-04-081-1/+1
|
* [3.13] gh-131544: Update docs for PyType_AddWatcher (gh-132015) (gh-132019)Miss Islington (bot)2025-04-021-0/+3
| | | | | | gh-131544: Update docs for PyType_AddWatcher (gh-132015) (cherry picked from commit 25275bda790e8a689092e83855d6d0574f26061b) Co-authored-by: Donghee Na <donghee.na@python.org>
* [3.13] Docs: Fix documentation for "PyTypeObject Definition" (GH-130936) ↵Miss Islington (bot)2025-03-201-1/+1
| | | | | | | | | (GH-131458) The structure definition for `PyTypeObject` is in `Include/cpython/object.h`, not in `Include/object.h`. (cherry picked from commit a0478c9f0c6d6a75ca35a8dc2c74d3b58877f094) Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
* [3.13] gh-131117: Update tp_finalize example to use PyErr_GetRaisedException ↵Miss Islington (bot)2025-03-191-4/+2
| | | | | | | | | | | | | | (GH-131118) (#131476) gh-131117: Update tp_finalize example to use PyErr_GetRaisedException (GH-131118) The tp_finalize C API doc used PyErr_Fetch() and PyErr_Restore() in its example code. That API was deprecated in 3.12. Update to point to the suggested replacement function PyErr_GetRaisedException() which has a sample usage. (cherry picked from commit a4832f6b9a62771725b159bc7cd6c49fb45e3bc8) Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
* [3.13] gh-118915: Document `PY_MONITORING_IS_INSTRUMENTED_EVENT` (GH-128026) ↵Miss Islington (bot)2025-03-191-0/+12
| | | | | | | (GH-131424) (cherry picked from commit f81990024554a75e2ab31133a72d9f0954690435) Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
* [3.13] gh-129675: Update documentation for tp_basicsize & tp_itemsize ↵Miss Islington (bot)2025-03-173-30/+83
| | | | | | | | | | | | | | | | | | (GH-129850) (GH-131079) - Add alignment requirement - Mention that ob_size is unreliable if you don't control it - Add some links for context - basicsize should include the base type in generaly not just PyObject - suggest Py_SIZE & Py_SET_SIZE This adds a “by-the-way” link to `PyObject_New`, which shouldn't be used for GC types. In order to be comfortable linking to it, I also add a link to `PyObject_GC_New` from its docs. And the same for `*Var` variants, while I'm here. (cherry picked from commit ad0f618ab3eb1f26f8830a863aaf7bb70835c00d) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.13] gh-130814: Enhance documentation for Python C API type objects ↵Miss Islington (bot)2025-03-141-2/+2
| | | | | | | | | | | | (GH-130817) (#131225) gh-130814: Enhance documentation for Python C API type objects (GH-130817) The "Type Objects" title in `c-api/typeobj.rst`, duplicating the title of `c-api/type.rst`, has been changed to "Type Objects Structures", thereby slightly improving Sphinx search. (cherry picked from commit 6b932edc5216d9766e70fef300a6b842ab33204c) Co-authored-by: sharktide <meherrihaan@gmail.com>
* [3.13] gh-130940: Remove PyConfig.use_system_logger (#131129)Russell Keith-Magee2025-03-131-11/+0
| | | | | | | Removes ``PyConfig.use_system_logger``, resolving an ABI incompatibility introduced in 3.13.2. Changes the default behavior of iOS to *always* direct stdout/stderr to the system log.
* [3.13] gh-130711: Document `PyBaseObject_Type` (GH-130712) (GH-130792)Miss Islington (bot)2025-03-101-0/+5
| | | | | | (cherry picked from commit b3c18bfd828ba90b9c712da74095c4a052887655) Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.13] Fix grammar typo in `Doc/c-api/arg.rst` (GH-130741) (#130759)Miss Islington (bot)2025-03-021-1/+1
| | | | | | Fix grammar typo in `Doc/c-api/arg.rst` (GH-130741) (cherry picked from commit 37145cb89fe806377a5e9ed1fdac92dd3a5df2c0) Co-authored-by: Arijit Kumar Das <arijitkrdas2004@outlook.com>
* [3.13] gh-46236: Add docs for PyUnicode_GetDefaultEncoding() doc (GH-130335) ↵Miss Islington (bot)2025-02-241-0/+9
| | | | | | | | | | | (GH-130511) * Clarify sys.getdefaultencoding() documentation * Add missing documentation for PyUnicode_GetDefaultEncoding, the C equivalent of sys.getdefaultencoding (cherry picked from commit 9f25c1f012c8d432a93bf2dcad5f19a64dc00d3c) Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
* [3.13] gh-129405: Fix doc for Py_mod_multiple_interpreters default, and add ↵Miss Islington (bot)2025-02-241-1/+1
| | | | | | | test (GH-129406) (GH-130507) (cherry picked from commit fc8d2cba541f378df0a439412665f3dbe0b9ae3c) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.13] Fix phrasing in paragraphs with leading "similar" (GH-121135) (#130364)Miss Islington (bot)2025-02-201-2/+2
| | | | Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
* [3.13] gh-46236: Document PyUnicode_RSplit, PyUnicode_Partition and ↵Miss Islington (bot)2025-02-201-0/+41
| | | | | | | | | PyUnicode_RPartition (GH-130191) (#130360) gh-46236: Document PyUnicode_RSplit, PyUnicode_Partition and PyUnicode_RPartition (GH-130191) (cherry picked from commit 0f5b82169e12321fd2294bf534496ad42a682ac4) Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.13] gh-130214: Document `PyEllipsis_Type` (GH-130215) (#130223)Miss Islington (bot)2025-02-171-0/+6
| | | | | | gh-130214: Document `PyEllipsis_Type` (GH-130215) (cherry picked from commit fc8c99a8ce483db23fa624592457e350e99193f6) Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
* [3.13] gh-82045: Correct and deduplicate "isprintable" docs; add test. ↵Stan Ulbrych2025-02-171-7/+2
| | | | | | | | | | | | | | | | | | | | (GH-130127) We had the definition of what makes a character "printable" documented in three places, giving two different definitions. The definition in the comment on `_PyUnicode_IsPrintable` was inverted; correct that. With that correction, the two definitions turn out to be equivalent -- but to confirm that, you have to go look up, or happen to know, that those are the only five "Other" categories and only three "Separator" categories in the Unicode character database. That makes it hard for the reader to tell whether they really are the same, or if there's some subtle difference in the intended semantics. Fix that by cutting the C API docs' and the C comment's copies of the subtle details, in favor of referring to the Python-level docs. That ensures it's explicit that these are all meant to agree, and also lets us concentrate improvements to the wording in one place. Speaking of which, borrow some ideas from the C comment, along with other tweaks, to hopefully add a bit more clarity to that one newly-centralized copy in the docs. Also add a thorough test that the implementation agrees with this definition. Author: Greg Price <gnprice@gmail.com> Co-authored-by: Greg Price <gnprice@gmail.com> (cherry picked from commit 3402e133ef26736296c07992266a82b181a5d532)
* [3.13] gh-130169: Fix broken list markup in `Doc/c-api/function.rst` ↵Miss Islington (bot)2025-02-161-6/+7
| | | | | | | | (GH-130174) (#130175) gh-130169: Fix broken list markup in `Doc/c-api/function.rst` (GH-130174) (cherry picked from commit 9837c2a21457e4eacabf606c44ec42d1962f11f1) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
* [3.13] gh-129912: Fix references to `Py_TPFLAGS_MANAGED_DICT` (gh-130044) ↵Miss Islington (bot)2025-02-121-1/+1
| | | | | | | (gh-130059) (cherry picked from commit 791cdfe1416a591e240b8ffc6f10eb6f659c8277) Co-authored-by: Satyam Kumar <isatyamks@gmail.com>
* [3.13] gh-101100: Docs: Fix some typos in the document (GH-129988) (#129997)Miss Islington (bot)2025-02-111-4/+4
| | | | | | Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com> Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* [3.13] gh-46236: Document `PyUnicode_DecodeCodePageStateful` (GH-127934) ↵Miss Islington (bot)2025-02-101-0/+7
| | | | | | | | | | | (GH-129961) gh-46236: Document `PyUnicode_DecodeCodePageStateful` (GH-127934) (cherry picked from commit 8d9d3e4ecb4c908df6560b54138dd5af73b3ed47) Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com> Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com> Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.13] gh-118915: Fix bad link in documentation (GH-129691) (GH-129723)Miss Islington (bot)2025-02-061-1/+1
| | | | | | gh-118915: Fix bad link in documentation (GH-129691) (cherry picked from commit 779d06945cbb59ec187a8c39300fb0ab6f9c0c1d) Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* [3.13] gh-101944: Clarify PyModule_AddObjectRef() documentation (GH-129433) ↵Miss Islington (bot)2025-02-031-3/+4
| | | | | | | | (#129612) gh-101944: Clarify PyModule_AddObjectRef() documentation (GH-129433) (cherry picked from commit 04264a286e5ddfe8ac7423f7376ca34a2ca8b7ba) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.13] gh-118915: C API: Document compiler flag macros (GH-129028) (GH-129086)Miss Islington (bot)2025-01-211-3/+15
| | | | | (cherry picked from commit 6e02096e2f9a18671d608f79dd61c5757deca4e8) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.13] Docs C API: Clarify what happens when null bytes are passed to ↵Miss Islington (bot)2025-01-201-0/+9
| | | | | | | | | | | `PyUnicode_AsUTF8` (GH-127458) (#129080) 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.13] gh-118915: Document `PyUnstable_InterpreterState_GetMainModule` ↵Miss Islington (bot)2025-01-101-0/+11
| | | | | | | (GH-128483) (GH-128677) (cherry picked from commit ea39c8b08d8f025273bfa5b7a95f7b5984dc1e86) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.13] gh-90241: Clarify documentation for PyUnicode_FSConverter and ↵Miss Islington (bot)2025-01-062-11/+36
| | | | | | | | | PyUnicode_FSDecoder (GH-128451) (GH-128542) (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.13] gh-77214: Update outdated documentation for numeric PyArg_Parse ↵Miss Islington (bot)2025-01-061-8/+14
| | | | | | | formats (GH-128454) (GH-128538) (cherry picked from commit 8d15058d61681e98579cf3fbd3c6fd13b3df6a72) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.13] gh-127954: Document PyObject_DelItemString (GH-127986) (#128496)Miss Islington (bot)2025-01-041-0/+7
| | | | | (cherry picked from commit 8ade15343d5daec3bf79ff7c47f03726fb2bcadf) Co-authored-by: RUANG (James Roy) <rruuaanng@outlook.com>
* [3.13] gh-125674: Doc: Fix type of newfunc first parameter (GH-125675) (#128449)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.13] gh-125887: Update PyObject_HasAttr exception behavior (GH-125907) ↵Miss Islington (bot)2024-12-271-1/+2
| | | | | | | | | | | | (#128283) gh-125887: Update PyObject_HasAttr exception behavior (GH-125907) Update PyObject_HasAttr exception behavior (cherry picked from commit 08a0728d6c32986d35edb26872b4512a71ae60f3) Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* [3.13] Document PyObject_SelfIter (GH-127861) (#127898)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.13] gh-118915: C API: Document frame locals proxies. (GH-127720) (#127831)Miss Islington (bot)2024-12-111-1/+21
| | | | | | | gh-118915: C API: Document frame locals proxies. (GH-127720) (cherry picked from commit dd9da738ad1d420fabafaded3fe63912b2b17cfb) Co-authored-by: Peter Bierma <zintensitydev@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* [3.13] gh-127791: Fix, document, and test `PyUnstable_AtExit` (GH-127793) ↵Peter Bierma2024-12-112-0/+13
| | | | | | | | | | (#127819) * Fix merge conflicts. * [3.13] gh-127791: Fix, document, and test `PyUnstable_AtExit` (GH-127793) (cherry picked from commit d5d84c3f13fe7fe591b375c41979d362bc11957a) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* [3.13] gh-126821: Add versionadded annotation to use_system_logger feature. ↵Miss Islington (bot)2024-12-101-0/+2
| | | | | | | | (GH-127755) (#127806) Add versionadded annotation to use_system_logger feature. (cherry picked from commit 51216857ca8283f5b41c8cf9874238da56da4968) Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
* [3.13] gh-126925: Modify how iOS test results are gathered (GH-127592) (#127754)Russell Keith-Magee2024-12-091-0/+9
| | | | | | | | Adds a `use_system_log` config item to enable stdout/stderr redirection for Apple platforms. This log streaming is then used by a new iOS test runner script, allowing the display of test suite output at runtime. The iOS test runner script can be used by any Python project, not just the CPython test suite. (cherry picked from commit 2041a95e68ebf6d13f867e214ada28affa830669)
* [3.13] gh-127253: Note that Stable ABI is about ABI stability (GH-127254) ↵Miss Islington (bot)2024-12-031-3/+11
| | | | | | | (GH-127557) (cherry picked from commit 35d37d6592d1be71ea76042165f6cbfa6c4c3a17) Co-authored-by: Petr Viktorin <encukou@gmail.com>
* [3.13] Docs: Fix incorrect indents in `c-api/type.rst` (GH-127449) (#127460)Yuki Kobayashi2024-12-011-20/+19
| | | (cherry picked from commit 33ce8dcf791721fea563715f681dc1593a35b83b)
* [3.13] fix param type in PyObject_HasAttrWithError (docs) (GH-127403) (#127404)Miss Islington (bot)2024-11-291-1/+1
| | | | | | fix param type in PyObject_HasAttrWithError (docs) (GH-127403) (cherry picked from commit 3afb639f39e89888194d8e74cc498c8da3a58d8e) Co-authored-by: biggus-developerus <74741815+biggus-developerus@users.noreply.github.com>
* [3.13] Fix macro expansions in critical section docs (GH-127226) (#127229)Miss Islington (bot)2024-11-241-2/+2
| | | | | (cherry picked from commit 2bb7846cacb342246aada5ed92d323e54c946063) Co-authored-by: da-woods <dw-git@d-woods.co.uk>
* [3.13] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code ↵Miss Islington (bot)2024-11-231-1/+5
| | | | | | | | (GH-126667) (#127201) Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (cherry picked from commit e3038e976b25a58f512d8c7083a752c89436eb0d) Co-authored-by: Richard Hansen <rhansen@rhansen.org>
* [3.13] Doc: C API: `PyThreadState::on_delete` was removed in v3.13 ↵Miss Islington (bot)2024-11-201-0/+3
| | | | | | | | (GH-126536) (#127053) Doc: C API: `PyThreadState::on_delete` was removed in v3.13 (GH-126536) (cherry picked from commit 9bca3ef575a088d3330a2743e36423aa5f7bdad8) Co-authored-by: Richard Hansen <rhansen@rhansen.org>
* [3.13] Doc: C API: Demote sections to subsections for consistency ↵Miss Islington (bot)2024-11-071-7/+7
| | | | | | | | | | | (GH-126535) (#126546) 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.13] Doc: C API: Delete claim that `PyObject_Init` is GC-aware (GH-126418) ↵Miss Islington (bot)2024-11-051-4/+2
| | | | | | | | (#126431) 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.13] Doc: C API: Move `tp_dealloc` paragraph to `tp_dealloc` section ↵Miss Islington (bot)2024-10-211-11/+13
| | | | | | | | | | | | | | (GH-125737) (#125798) 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.13] gh-125313: Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` ↵Miss Islington (bot)2024-10-211-4/+7
| | | | | | | | | | | | deprecation notes (GH-125317) (#125776) gh-125313: Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation notes (GH-125317) Prefer `sys.base_*` paths in `Py_Get(Exec)Prefix` deprecation notes. (cherry picked from commit 7d88140d5299bd086434840db66ede8ccd01a688) Signed-off-by: y5c4l3 <y5c4l3@proton.me> Co-authored-by: Y5 <124019959+y5c4l3@users.noreply.github.com>
* [3.13] Doc: Fix typos (GH-125728) (#125773)Miss Islington (bot)2024-10-213-3/+3
| | | | | (cherry picked from commit ded105a62b9d78717f8dc64652e3903190b585dd) Co-authored-by: ember91 <31469580+ember91@users.noreply.github.com>
* [3.13] gh-101291: Add versionadded directives for PyUnstable_Long_* ↵Miss Islington (bot)2024-10-131-0/+5
| | | | | | | | (GH-125384) (#125407) 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.13] gh-101100: Consolidate documentation on `ModuleType` attributes ↵Alex Waygood2024-10-092-23/+25
| | | | | | | | (#124709) (#125208) 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.13] bpo-34206: Improve docs and test coverage for pre-init functions ↵Alyssa Coghlan2024-10-083-69/+146
| | | | | | | | | | | | | | | | | | | | | | | | (GH-8023) (#125092) - move the Py_Main documentation from the very high level API section to the initialization and finalization section - make it clear that it encapsulates a full Py_Initialize/Finalize cycle of its own - point out that exactly which settings will be read and applied correctly when Py_Main is called after a separate runtime initialization call is version dependent - be explicit that Py_IsInitialized can be called prior to initialization - actually test that Py_IsInitialized can be called prior to initialization - flush stdout in the embedding tests that run code so it appears in the expected order when running with "-vv" - make "-vv" on the subinterpreter embedding tests less spammy --------- (cherry picked from commit 7c4b6a68f263320a2dd19cd5ff63b35c964b1fa8) Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* [3.13] gh-70870: Clarify dual usage of 'free variable' (GH-122545) (#125088)Miss Islington (bot)2024-10-081-3/+6
| | | | | | | | | | | | | | | | | The term "free variable" has unfortunately become genuinely ambiguous over the years (presumably due to the names of some relevant code object instance attributes). While we can't eliminate that ambiguity at this late date, we can at least alert people to the potential ambiguity by describing both the formal meaning of the term and the common alternative use as a direct synonym for "closure variable". --------- (cherry picked from commit 27390990fa9306e2a797a4eb2bd83c5bfc7cb186) Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>