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()`.
This commit is contained in:
Sam Gross
2024-02-02 08:03:15 -05:00
committed by GitHub
parent 0e71a295e9
commit d0f1307580
12 changed files with 68 additions and 11 deletions

1
PC/python3dll.c generated
View File

@@ -324,6 +324,7 @@ EXPORT_FUNC(PyIter_Send)
EXPORT_FUNC(PyList_Append)
EXPORT_FUNC(PyList_AsTuple)
EXPORT_FUNC(PyList_GetItem)
EXPORT_FUNC(PyList_GetItemRef)
EXPORT_FUNC(PyList_GetSlice)
EXPORT_FUNC(PyList_Insert)
EXPORT_FUNC(PyList_New)