◐ Shell
clean mode source ↗

gh-114329: Add `PyList_GetItemRef` function by colesbury · Pull Request #114504 · python/cpython

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()`.

@bedevere-app Bot mentioned this pull request

Jan 23, 2024

vstinner

serhiy-storchaka

@colesbury

@colesbury

vstinner

corona10

erlend-aasland

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>

aisk pushed a commit to aisk/cpython that referenced this pull request

Feb 11, 2024
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()`.

fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this pull request

Feb 14, 2024
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()`.