From 3253a52f9de6d0b470b6e5ad487b8d7eef92d0dd Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 2 Jul 2023 18:11:45 +0200 Subject: [PATCH 1/4] gh-106320: Remove private _PyInterpreterState functions (#106335) Remove private _PyThreadState and _PyInterpreterState C API functions: move them to the internal C API (pycore_pystate.h and pycore_interp.h). Don't export most of these functions anymore, but still export functions used by tests. Remove _PyThreadState_Prealloc() and _PyThreadState_Init() from the C API, but keep it in the stable API. From fee3f116d8c0e6c667d1eaa9bb7d5c3b195705a5 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Sat, 30 Dec 2023 16:00:03 +0000 Subject: [PATCH 2/4] Doc: minor change --- Doc/library/array.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/Doc/library/array.rst b/Doc/library/array.rst index e0b1eb89cf6c05..3c9658ebd72105 100644 --- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -279,3 +279,4 @@ Examples:: `NumPy `_ The NumPy package defines another array type. + From ed4cc6fd5adac9505c70a07a7b73ead613ad95e6 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Mon, 25 Mar 2024 19:23:48 +0000 Subject: [PATCH 3/4] Revert "Doc: minor change" This reverts commit ebfa0937c2caf0110ab1540f14956d56fe925092. --- Doc/library/array.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/Doc/library/array.rst b/Doc/library/array.rst index 3c9658ebd72105..e0b1eb89cf6c05 100644 --- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -279,4 +279,3 @@ Examples:: `NumPy `_ The NumPy package defines another array type. - From e3c43bb0c291c3f5c834caba6d840f9a2888e2be Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Tue, 22 Jul 2025 19:53:25 +0100 Subject: [PATCH 4/4] gh-106318: Add example for str.index() --- Doc/library/stdtypes.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 90683c0b00d78a..c040bc4e62e035 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1970,7 +1970,18 @@ expression support in the :mod:`re` module). .. method:: str.index(sub[, start[, end]]) Like :meth:`~str.find`, but raise :exc:`ValueError` when the substring is - not found. + not found. For example: + + .. doctest:: + + >>> 'spam, spam, spam'.index('eggs') + Traceback (most recent call last): + File "", line 1, in + 'spam, spam, spam'.index('eggs') + ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^ + ValueError: substring not found + + See also :meth:`rindex`. .. method:: str.isalnum()