Skip to content
Merged
8 changes: 8 additions & 0 deletions Doc/c-api/dict.rst
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ Dictionary Objects
value represents offsets within the internal dictionary structure, and
since the structure is sparse, the offsets are not consecutive.

.. note::

In the free-threaded build, this function can be used safely inside
Comment thread
ZeroIntensity marked this conversation as resolved.
Outdated
a critical section. However, the references returned for *pkey* and
*pvalue* are borrowed and only valid while the critical section is
Comment thread
ZeroIntensity marked this conversation as resolved.
Outdated
held. If you need to use these objects outside the critical section,
Comment thread
eendebakpt marked this conversation as resolved.
Outdated
create strong references (for example, with :c:func:`Py_NewRef`).
Comment thread
ZeroIntensity marked this conversation as resolved.
Outdated

For example::

PyObject *key, *value;
Expand Down
Loading