cpython/Misc/NEWS.d/next/C API/2024-01-23-21-45-02.gh-issue-114329.YRaBoe.rst
Sam Gross d0f1307580
gh-114329: Add PyList_GetItemRef function (GH-114504)
The new `PyList_GetItemRef` is similar to `PyList_GetItem`, but returns
a strong reference instead of a borrowed reference. Additionally, if the
passed "list" object is not a list, the function sets a `TypeError`
instead of calling `PyErr_BadInternalCall()`.
2024-02-02 14:03:15 +01:00

3 lines
158 B
ReStructuredText

Add :c:func:`PyList_GetItemRef`, which is similar to
:c:func:`PyList_GetItem` but returns a :term:`strong reference` instead of a
:term:`borrowed reference`.