Skip to content

Commit 1ae1db8

Browse files
[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 80cdf3e) Co-authored-by: Petr Viktorin <[email protected]>
1 parent 622f37f commit 1ae1db8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Doc/c-api/init.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,9 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
15471547
This is not a replacement for :c:func:`PyModule_GetState()`, which
15481548
extensions should use to store interpreter-specific state information.
15491549
1550+
The returned dictionary is borrowed from the interpreter and is valid until
1551+
interpreter shutdown.
1552+
15501553
.. versionadded:: 3.8
15511554
15521555

Doc/data/refcounts.dat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,9 @@ PyInterpreterState_Clear:PyInterpreterState*:interp::
11441144
PyInterpreterState_Delete:void:::
11451145
PyInterpreterState_Delete:PyInterpreterState*:interp::
11461146

1147+
PyInterpreterState_GetDict:PyObject*::0:
1148+
PyInterpreterState_GetDict:PyInterpreterState*:interp::
1149+
11471150
PyInterpreterState_GetID:int64_t:::
11481151
PyInterpreterState_GetID:PyInterpreterState*:interp::
11491152

0 commit comments

Comments
 (0)