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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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)