]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Document that `PyInterpreterState_GetDict` returns a borrowed reference (#139451)
authorPetr Viktorin <encukou@gmail.com>
Wed, 1 Oct 2025 04:16:06 +0000 (06:16 +0200)
committerGitHub <noreply@github.com>
Wed, 1 Oct 2025 04:16:06 +0000 (09:46 +0530)
Doc/c-api/init.rst
Doc/data/refcounts.dat

index 4b8884f48e8b286db2646abdeeda8a1dd98c74af..ccf85e627f9b5f36222fb14a1a9265d2be5e395f 100644 (file)
@@ -1382,6 +1382,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 44ee25863012593f6042394ca687400a0d243a52..48f4f4919e896619c608a56845a4868b1fa1968b 100644 (file)
@@ -1141,6 +1141,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::