]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] Document that `PyInterpreterState_GetDict` returns a borrowed reference (GH...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 1 Oct 2025 05:39:54 +0000 (07:39 +0200)
committerGitHub <noreply@github.com>
Wed, 1 Oct 2025 05:39:54 +0000 (08:39 +0300)
Document that `PyInterpreterState_GetDict` returns a borrowed reference (GH-139451)
(cherry picked from commit 80cdf3ef74f6622899c1c82af1e08492e4ab7a00)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Doc/c-api/init.rst
Doc/data/refcounts.dat

index 6a272a4f5fcb8742f55a473fdb64cff7f6ef00c4..416bece23bcbb4c20ec7f612e3606465687f28da 100644 (file)
@@ -1547,6 +1547,9 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
    This is not a replacement for :c:func:`PyModule_GetState()`, which
    extensions should use to store interpreter-specific state information.
 
+   The returned dictionary is borrowed from the interpreter and is valid until
+   interpreter shutdown.
+
    .. versionadded:: 3.8
 
 
index a6f1fc4e937c946eed61571f0289a9904c14fe6b..1cc1b44a5b8e3a2a82bc7c5dab1f596d8216358b 100644 (file)
@@ -1144,6 +1144,9 @@ PyInterpreterState_Clear:PyInterpreterState*:interp::
 PyInterpreterState_Delete:void:::
 PyInterpreterState_Delete:PyInterpreterState*:interp::
 
+PyInterpreterState_GetDict:PyObject*::0:
+PyInterpreterState_GetDict:PyInterpreterState*:interp::
+
 PyInterpreterState_GetID:int64_t:::
 PyInterpreterState_GetID:PyInterpreterState*:interp::