Skip to content

Commit 9b7bb3e

Browse files
encukoumiss-islington
authored andcommitted
Document that PyInterpreterState_GetDict returns a borrowed reference (pythonGH-139451)
(cherry picked from commit 80cdf3e) Co-authored-by: Petr Viktorin <[email protected]>
1 parent f48128b commit 9b7bb3e

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
@@ -1477,6 +1477,9 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
14771477
This is not a replacement for :c:func:`PyModule_GetState()`, which
14781478
extensions should use to store interpreter-specific state information.
14791479
1480+
The returned dictionary is borrowed from the interpreter and is valid until
1481+
interpreter shutdown.
1482+
14801483
.. versionadded:: 3.8
14811484
14821485

Doc/data/refcounts.dat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,9 @@ PyInterpreterState_Clear:PyInterpreterState*:interp::
11481148
PyInterpreterState_Delete:void:::
11491149
PyInterpreterState_Delete:PyInterpreterState*:interp::
11501150

1151+
PyInterpreterState_GetDict:PyObject*::0:
1152+
PyInterpreterState_GetDict:PyInterpreterState*:interp::
1153+
11511154
PyInterpreterState_GetID:int64_t:::
11521155
PyInterpreterState_GetID:PyInterpreterState*:interp::
11531156

0 commit comments

Comments
 (0)