Commit graph

1843 commits

Author SHA1 Message Date
Miss Islington (bot)
7ab08d2c51
[3.14] gh-141004: Document Py_UNICODE_{HIGH, LOW}_SURROGATE functions (GH-141019) (GH-141027)
gh-141004: Document `Py_UNICODE_{HIGH, LOW}_SURROGATE` functions (GH-141019)
(cherry picked from commit bfe54810c4)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-11-04 21:33:52 +00:00
Hugo van Kemenade
25a2a60371
[3.14] Fix minor typos and wording in C API docs (GH-140955) (#140966)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-11-04 09:46:08 +02:00
Miss Islington (bot)
6ab4dfb560
[3.14] Docs: avoid informal formulation in Doc/c-api/conversion.rst (GH-140898) (#140912)
Docs: avoid informal formulation in `Doc/c-api/conversion.rst` (GH-140898)
(cherry picked from commit 173cc53d9f)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-11-02 13:57:26 +00:00
Miss Islington (bot)
4d7fab9b15
[3.14] Docs: fix some grammatical errors in Doc/c-api/dict.rst (GH-140899) (#140901)
Docs: fix some grammatical errors in `Doc/c-api/dict.rst` (GH-140899)
(cherry picked from commit d12cbf2865)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-11-02 08:38:56 +00:00
Miss Islington (bot)
5ae4612e72
[3.14] Docs: Replace "encoder" with "decoder" in Doc/c-api/codec.rst (GH-140613) (#140661)
Docs: Replace "encoder" with "decoder" in `Doc/c-api/codec.rst` (GH-140613)
(cherry picked from commit d12086e822)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-10-27 09:51:14 +00:00
Miss Islington (bot)
57ba6aedf6
[3.14] Docs: Fix a grammatical error in Doc/c-api/codec.rst (GH-140612) (#140616)
Docs: Fix a grammatical error in `Doc/c-api/codec.rst` (GH-140612)
(cherry picked from commit 33b2ca80bb)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-10-26 09:45:34 +00:00
Miss Islington (bot)
62c9d48378
[3.14] Fix typo in Doc/c-api/code.rst (GH-140586) (#140591)
Fix typo in `Doc/c-api/code.rst` (GH-140586)
(cherry picked from commit d74a96366d)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-10-25 15:41:04 +00:00
Miss Islington (bot)
568cf8b4af
[3.14] Docs: Fix a grammatical error in Doc/c-api/capsule.rst (GH-140577) (GH-140580)
Docs: Fix a grammatical error in `Doc/c-api/capsule.rst` (GH-140577)

"who" -> "which"
(cherry picked from commit 4ad599501f)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-10-25 14:02:20 +00:00
Miss Islington (bot)
a975bea9b5
[3.14] Document that PyModule_GetDef can return NULL with or without setting an exception (GH-140529) (GH-140545)
(cherry picked from commit 289360ae63)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-24 13:36:35 +00:00
Miss Islington (bot)
4bb2f1f322
[3.14] Docs: Fix a grammatical error in Doc/c-api/arg.rst (GH-140525) (GH-140538)
Docs: Fix a grammatical error in `Doc/c-api/arg.rst` (GH-140525)

"have" -> "has"
(cherry picked from commit fc2e23c2ed)

Co-authored-by: RayXu <140802139+F18-Maverick@users.noreply.github.com>
2025-10-24 12:24:26 +00:00
Miss Islington (bot)
3cef7801dd
[3.14] gh-107073: fix relevant typo in PyObject_ClearManagedDict (GH-140032) (#140033)
gh-107073: fix relevant typo in `PyObject_ClearManagedDict` (GH-140032)
(cherry picked from commit 52996aaa78)

Co-authored-by: Mikhail Efimov <efimov.mikhail@gmail.com>
2025-10-13 11:30:27 +00:00
Miss Islington (bot)
08faef865c
[3.14] gh-101100: Fix reference warnings in c-api/init.rst documenting PyGILState_STATE (GH-139572) (#139832)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-10-09 09:41:57 +00:00
Miss Islington (bot)
8db6615886
[3.14] gh-129368: In PyRun C API docs, clarify what a "start token" is (GH-129935) (#139042)
gh-129368: In PyRun C API docs, clarify what a "start token" is (GH-129935)
(cherry picked from commit e1eca8b308)

Co-authored-by: Rajhans Jadhao <rajhans.jadhao@gmail.com>
2025-10-07 19:30:05 +01:00
Miss Islington (bot)
f899c849d4
[3.14] Remove unmatched closing parenthesis (GH-139082) (#139099)
Remove unmatched closing parenthesis (GH-139082)
(cherry picked from commit d22b25081b)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-10-07 19:24:17 +01:00
Miss Islington (bot)
292b6cf3e6
[3.14] Document Py_AddPendingCall() change with subinterpreters in 3.12 (GH-139117) (#139118)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-10-03 23:20:35 +03:00
Miss Islington (bot)
1ae1db8056
[3.14] Document that PyInterpreterState_GetDict returns a borrowed reference (GH-139451) (#139463)
Document that `PyInterpreterState_GetDict` returns a borrowed reference (GH-139451)
(cherry picked from commit 80cdf3ef74)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-10-01 08:39:54 +03:00
Miss Islington (bot)
5eb7cd3e38
[3.14] Add impl-detail block for PyLong_FromLong docs (GH-126422) (#138694)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-09-11 12:23:36 +03:00
Miss Islington (bot)
47441f0874
[3.14] gh-138644: Update c-api docs of PyInterpreterState about PEP-684 (GH-138651) (#138657)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-09-11 12:23:24 +03:00
Miss Islington (bot)
4bba1a294b
[3.14] Fix documentation of hash in PyHash_FuncDef (GH-137595) (#137642)
Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2025-09-11 12:15:06 +03:00
Miss Islington (bot)
7f5319dd54
[3.14] gh-137368: document __index__() support for PyLong_AsInt32/64() (GH-137369) (#137380)
gh-137368: document __index__() support for PyLong_AsInt32/64() (GH-137369)
(cherry picked from commit 4dd85b347f)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-09-11 12:14:03 +03:00
Miss Islington (bot)
97c6d725e1
[3.14] enhance docs for critical sections (GH-137334) (#138167)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-08-27 17:40:27 +03:00
Miss Islington (bot)
65bf6f549b
[3.14] gh-138098: Clarify strong references in PyDict_Next docs on the free-threaded build (GH-138106) (#138141)
Co-authored-by: PrinceNaroliya <naroliyaprince@gmail.com>
2025-08-27 16:58:07 +03:00
Serhiy Storchaka
805daa2edb
[3.14] Revert "gh-112068: C API: Add support of nullable arguments in PyArg_Parse (GH-121303)" (GH-136991) (#137006) 2025-07-22 19:16:31 +03:00
Hugo van Kemenade
8e43b130f7
[3.14] gh-134009: Expose PyMutex_IsLocked in the public C API (gh-134365) (#136971)
Co-authored-by: Sam Gross <colesbury@gmail.com>
2025-07-22 12:48:08 +03:00
Miss Islington (bot)
11f510167c
[3.14] gh-133296: Publicly expose critical section API that accepts PyMutex (gh-135899) (#136969)
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-07-22 12:44:59 +03:00
Miss Islington (bot)
cce38eefd4
[3.14] Doc/c-api/memory.rst: extend --without-pymalloc doc with ASan information (GH-136790) (GH-136798)
Extend the documentation for disabling pymalloc with the `--without-pymalloc` flag regarding why it is worth to use it when enabling AddressSanitizer for Python build (which is done, e.g., in CPython's CI builds).

I have tested the CPython latest main build with both ASan and pymalloc enabled and it seems to work just fine. I did run the `python -m test` suite which didn't uncover any ASan crashes (though, it detected some memory leaks, which I believe are irrelevant here).

I have discussed ASan and this flag with @encukou on the CPython Core sprint on EuroPython 2025. We initially thought that the `--without-pymalloc` flag is needed for ASan builds due to the fact pymalloc must hit the begining of page when determining if the memory to be freed comes from pymalloc or was allocated by the system malloc. In other words, we thought, that ASan would crash CPython during free of big objects (allocated by system malloc). It may be that this was the case in the past, but it is not the case anymore as the `address_in_range` function used by pymalloc is annotated to be skipped from the ASan instrumentation.


(cherry picked from commit d19bb44713)

Co-authored-by: Disconnect3d <dominik.b.czarnota@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-07-20 10:55:06 +02:00
Miss Islington (bot)
088d79e3ee
[3.14] gh-136663: fix signatures of PyFloat_Pack/Unpack in docs (GH-136664) (#136666)
gh-136663: fix signatures of PyFloat_Pack/Unpack in docs (GH-136664)
(cherry picked from commit e4654e0b3e)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-07-15 05:36:47 +00:00
Miss Islington (bot)
a1ed132a19
[3.14] Docs: Fix and improve the PyUnstable_Object_EnableDeferredRefcount documentation (GH-135323) (GH-136610)
Docs: Fix and improve the `PyUnstable_Object_EnableDeferredRefcount` documentation (GH-135323)
(cherry picked from commit 0d4fd10fba)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-07-13 06:52:58 +00:00
Miss Islington (bot)
1346049782
[3.14] gh-136209: Add .. c:var:: declarations for C exception types (GH-136210) (GH-136504)
(cherry picked from commit 85bc89f35f)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-07-10 15:10:43 +02:00
Miss Islington (bot)
78e5d109f5
[3.14] gh-135913: Document ob_refcnt, ob_type, ob_size (GH-135914) (GH-136377)
gh-135913: Document ob_refcnt, ob_type, ob_size (GH-135914)

* gh-135913: Document ob_refcnt, ob_type, ob_size

In `typeobj.rst`, instead of `:c:member:` it would be better to
use `.. c:member::` with a `:no-index:` option, see:

See ref. https://www.sphinx-doc.org/en/master/usage/domains/index.html#basic-markup

However, `c:member` currently does not support `:no-index:`.
(cherry picked from commit 73e1207a4e)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-07-08 08:03:03 +02:00
Miss Islington (bot)
5df4f353ad
[3.14] gh-135755: Document __future__.* and CO_* as proper Sphinx objects (GH-135980) (GH-136370)
* Turn the __future__ table to list-table.
  This'll make it easier to add entries that need longer markup
* Semantic markup for __future__ feature descriptions.
* Document CO_* C macros.

(cherry picked from commit 2468aafe98)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-07-07 12:55:20 +02:00
Miss Islington (bot)
42e13b8f8a
[3.14] gh-76595: Add note on PyCapsule_Import behavior (GH-134022) (GH-136074)
gh-76595: Add note on `PyCapsule_Import` behavior (GH-134022)
(cherry picked from commit 579acf4562)

Co-authored-by: Nicolas Trangez <ikke@nicolast.be>
2025-06-28 13:08:15 +00:00
Miss Islington (bot)
b99a417a6a
[3.14] Docs: Fix duplicate word typos (GH-135958) (GH-136007)
(cherry picked from commit 34ce1920ca)

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-06-27 00:05:53 +00:00
Miss Islington (bot)
349f4c24f9
[3.14] gh-135755: Docs: C API: Document missing PyFunction_GET* macros (GH-135762) (GH-135916)
gh-135755: Docs: C API: Document missing `PyFunction_GET*` macros (GH-135762)

(cherry picked from commit ca87a47b3d)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-06-25 10:50:56 +02:00
Miss Islington (bot)
f0a330e5fb
[3.14] gh-89488: Add warning about Py_BuildValue("p") needing exact int (GH-135610) (GH-135843)
(cherry picked from commit 6aa0826ed7)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-06-23 10:41:39 +00:00
Miss Islington (bot)
73e2089ed1
[3.14] Docs: Remove unnecessary trailing backslashes (GH-135781) (GH-135791)
Docs: Remove unnecessary trailing backslashes (GH-135781)

This fixes Sphinx's gettext extraction for translations.
(cherry picked from commit 6a16b3c440)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-06-21 13:07:51 +00:00
Miss Islington (bot)
bd24261728
[3.14] Docs: Document PyExceptionClass functions in the C API (GH-135697) (GH-135757)
Docs: Document `PyExceptionClass` functions in the C API (GH-135697)

* Docs: Document `PyExceptionClass_Name`

`PyExceptionClass_Name` is an undocumented function in the limited API.

* Document `PyExceptionClass_Check`
(cherry picked from commit 59963e866a)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-06-20 14:03:46 +00:00
Miss Islington (bot)
aee789cf97
[3.14] Document that PyType_GetModuleByDef returns a borrowed reference (GH-135666) (GH-135701)
(cherry picked from commit 140731ff67)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-06-19 09:17:53 +02:00
Miss Islington (bot)
1734b295b3
[3.14] Docs: Fix markups for emphasis (GH-135598) (GH-135685)
Docs: Fix markups for emphasis (GH-135598)

The word emphasis character `_` is not supported as sphinx markup, so changed to `*`.
(cherry picked from commit 46c60e0d0b)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-06-18 17:39:06 +00:00
Hugo van Kemenade
26d485d122 Python 3.14.0b3 2025-06-17 18:40:54 +03:00
Miss Islington (bot)
0e0ad7b8ff
[3.14] gh-134160: Split extension module init from PyModule docs; emphasize multi-phase init (GH-135126) (#135470)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-06-16 18:01:09 +03:00
Miss Islington (bot)
98136ddb0e
[3.14] gh-133264: Correct documentation of how Py_Main and Py_RunMain handle SystemExit (GH-135337) (#135394)
gh-133264: Correct documentation of how Py_Main and Py_RunMain handle SystemExit (GH-135337)
(cherry picked from commit b706ff003c)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
2025-06-11 15:29:46 +00:00
Miss Islington (bot)
725ec53032
[3.14] bpo-45210: Document that error indicator may be set in tp_dealloc (GH-28358) (#135298)
bpo-45210: Document that error indicator may be set in tp_dealloc (GH-28358)
(cherry picked from commit 8441b263af)

Signed-off-by: Edward Z. Yang <ezyang@fb.com>
Signed-off-by: Edward Z. Yang <ezyang@meta.com>
Co-authored-by: Edward Z. Yang <ezyang@mit.edu>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-06-09 13:01:33 +00:00
Victor Stinner
3d69d18322
[3.14] gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973) (#134974)
gh-133968: Add PyUnicodeWriter_WriteASCII() function (#133973)

Replace most PyUnicodeWriter_WriteUTF8() calls with
PyUnicodeWriter_WriteASCII().

(cherry picked from commit f49a07b531)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-06-09 14:37:26 +02:00
Miss Islington (bot)
88b5784fc0
[3.14] Docs: Update PyExc_* tables in the c-api documentation (GH-131640) (GH-135220)
Docs: Update `PyExc_*` tables in the c-api documentation (GH-131640)

Add `PyExc_BaseExceptionGroup` and `PyExc_EncodingWarning`
(cherry picked from commit f00512db20)

Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2025-06-06 15:57:37 +00:00
Miss Islington (bot)
daf11fca03
[3.14] Fix versionadded directive rendering in c-api/arg.rst (GH-135199) (#135207)
Fix versionadded directive rendering in c-api/arg.rst (GH-135199)
(cherry picked from commit 39859fcac5)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-06-06 12:30:33 +00:00
Miss Islington (bot)
d420d82c63
[3.14] gh-134830: Fix reference in Doc/extending/windows.rst (GH-134831) (GH-135058)
(cherry picked from commit 0ac9e17fb4)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2025-06-03 06:33:04 +00:00
Miss Islington (bot)
7ac461883d
[3.14] Remove newline in Doc/c-api/lifecycle.rst for gettext builder (GH-135013) (GH-135038)
(cherry picked from commit c7051a3669)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2025-06-02 18:19:54 +00:00
Miss Islington (bot)
f734531bbe
[3.14] gh-134160: Improve multi-phase init note on isolation & subinterpreters (GH-134775) (#134932)
gh-134160: Improve multi-phase init note on isolation & subinterpreters (GH-134775)

(cherry picked from commit eb145fabbd)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-05-31 18:41:07 +01:00
Miss Islington (bot)
02712fa848
Doc: remove unnecessary section header (GH-134917)
(cherry picked from commit b367e27af9)
2025-05-30 18:13:36 +09:00