We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3706ef6 commit cecf233Copy full SHA for cecf233
Doc/c-api/dict.rst
@@ -258,6 +258,14 @@ Dictionary Objects
258
value represents offsets within the internal dictionary structure, and
259
since the structure is sparse, the offsets are not consecutive.
260
261
+ .. note::
262
+
263
+ In the free-threaded build, this function can be used safely inside
264
+ a critical section. However, the references returned for *pkey* and
265
+ *pvalue* are borrowed and only valid while the critical section is
266
+ held. If you need to use these objects outside the critical section,
267
+ create strong references (for example, with :c:func:`Py_NewRef`).
268
269
For example::
270
271
PyObject *key, *value;
0 commit comments