https://github.com/python/cpython/commit/1ae1db8056770a5979c7b359dc80f0fb8c06a383
commit: 1ae1db8056770a5979c7b359dc80f0fb8c06a383
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2025-10-01T08:39:54+03:00
summary:

[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 80cdf3ef74f6622899c1c82af1e08492e4ab7a00)

Co-authored-by: Petr Viktorin <[email protected]>

files:
M Doc/c-api/init.rst
M Doc/data/refcounts.dat

diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst
index 6a272a4f5fcb87..416bece23bcbb4 100644
--- a/Doc/c-api/init.rst
+++ b/Doc/c-api/init.rst
@@ -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
 
 
diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat
index a6f1fc4e937c94..1cc1b44a5b8e3a 100644
--- a/Doc/data/refcounts.dat
+++ b/Doc/data/refcounts.dat
@@ -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::
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to