Commit graph

1851 commits

Author SHA1 Message Date
Miss Islington (bot)
5d10409e33
[3.14] gh-141004: Document PyLong_FromPid and PyLong_AsPid (GH-141028) (GH-141142)
gh-141004: Document `PyLong_FromPid` and `PyLong_AsPid` (GH-141028)
(cherry picked from commit bcc524f82d)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-06 14:07:56 +00:00
Miss Islington (bot)
eac7b9fa97
[3.14] gh-141004: Document Py_hexdigits (GH-141059) (GH-141138)
gh-141004: Document `Py_hexdigits` (GH-141059)
(cherry picked from commit 54110e20e0)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-11-06 13:56:41 +00:00
Miss Islington (bot)
cd5508d322
[3.14] gh-141004: Document built-in iterator types in the C API (GH-141006) (GH-141134)
gh-141004: Document built-in iterator types in the C API (GH-141006)

Adds documentation for each of the following:

- PyEnum_Type
- PyFilter_Type
- PyMap_Type
- PyReversed_Type
- PyZip_Type

In addition, PyRange_Type and PyRange_Check are also documented.
(cherry picked from commit 1697cb5710)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-06 12:35:02 +00:00
Hugo van Kemenade
7168553c00
[3.14] gh-138189: Document type slots, and other constants, as part of Limited API (GH-138190) (GH-141131)
(cherry picked from commit d81e1ef0f3)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-06 12:39:19 +01:00
Miss Islington (bot)
5561837085
[3.14] gh-141004: Document PyDict_GET_SIZE (GH-141078) (GH-141082)
gh-141004: Document `PyDict_GET_SIZE` (GH-141078)
(cherry picked from commit f0ab07f22c)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-05 22:38:20 +00:00
Miss Islington (bot)
090c0f1403
[3.14] gh-141004: Document Py_RETURN_NAN and Py_RETURN_INF (GH-141029) (GH-141074)
gh-141004: Document `Py_RETURN_NAN` and `Py_RETURN_INF` (GH-141029)
(cherry picked from commit 5b02c6e920)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-11-05 22:05:47 +00:00
Miss Islington (bot)
378912975b
[3.14] gh-141004: Document PyMemoryView_Type (GH-141034) (GH-141054)
gh-141004: Document `PyMemoryView_Type` (GH-141034)
(cherry picked from commit 3f6aca1be4)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-11-05 16:51:34 +00:00
Miss Islington (bot)
39ca786918
[3.14] gh-141004: Document missing iterator types in the C API (GH-141010) (GH-141046)
gh-141004: Document missing iterator types in the C API (GH-141010)

Add documentation for each of the following:

- PyByteArrayIter_Type
- PyBytesIter_Type
- PyListIter_Type
- PyListRevIter_Type
- PySetIter_Type
- PyTupleIter_Type
- PyRangeIter_Type
- PyLongRangeIter_Type
- PyDictIterKey_Type
- PyDictRevIterKey_Type
- PyDictIterValue_Type
- PyDictRevIterValue_Type
- PyDictIterItem_Type
- PyDictRevIterItem_Type

---------
(cherry picked from commit 35528fccdc)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-11-05 14:20:04 +00:00
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