From 3253a52f9de6d0b470b6e5ad487b8d7eef92d0dd Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Sun, 2 Jul 2023 18:11:45 +0200 Subject: [PATCH 1/5] 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/5] 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/5] 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 3608c8c4ed6c63fc1728fb4809eb217a3563b4b2 Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Tue, 22 Jul 2025 18:47:18 +0100 Subject: [PATCH 4/5] gh-106318: Add example for str.format() --- Doc/library/stdtypes.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 90683c0b00d78a..e6bf9d3d572047 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1927,10 +1927,14 @@ expression support in the :mod:`re` module). ``{}``. Each replacement field contains either the numeric index of a positional argument, or the name of a keyword argument. Returns a copy of the string where each replacement field is replaced with the string value of - the corresponding argument. + the corresponding argument. For example: + + .. doctest:: >>> "The sum of 1 + 2 is {0}".format(1+2) 'The sum of 1 + 2 is 3' + >>> "{1} expects the {0} Inquisition!".format("Spanish", "Nobody") + 'Nobody expects the Spanish Inquisition!' See :ref:`formatstrings` for a description of the various formatting options that can be specified in format strings. From 06a6532871fe689fb2471b28ddf9ef528ff03cfd Mon Sep 17 00:00:00 2001 From: Adorilson Bezerra Date: Sun, 3 Aug 2025 20:03:58 +0100 Subject: [PATCH 5/5] gh-106318: Add example for str.format() with keyword argument --- Doc/library/stdtypes.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index e6bf9d3d572047..8ce7b4335a0472 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1933,6 +1933,8 @@ expression support in the :mod:`re` module). >>> "The sum of 1 + 2 is {0}".format(1+2) 'The sum of 1 + 2 is 3' + >>> "The sum of {a} + {b} is {answer}".format(answer=1+2, a=1, b=2) + 'The sum of 1 + 2 is 3' >>> "{1} expects the {0} Inquisition!".format("Spanish", "Nobody") 'Nobody expects the Spanish Inquisition!'