]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-114329: Add `PyList_GetItemRef` function (GH-114504)
authorSam Gross <colesbury@gmail.com>
Fri, 2 Feb 2024 13:03:15 +0000 (08:03 -0500)
committerGitHub <noreply@github.com>
Fri, 2 Feb 2024 13:03:15 +0000 (14:03 +0100)
commitd0f1307580a69372611d27b04bbf2551dc85a1ef
treec690e6915eb44d57fc8af1623dc57babe3eca3ab
parent0e71a295e9530c939a5efcb45db23cf31e0303b4
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()`.
12 files changed:
Doc/c-api/list.rst
Doc/data/refcounts.dat
Doc/data/stable_abi.dat
Doc/whatsnew/3.13.rst
Include/listobject.h
Lib/test/test_capi/test_list.py
Lib/test/test_stable_abi_ctypes.py
Misc/NEWS.d/next/C API/2024-01-23-21-45-02.gh-issue-114329.YRaBoe.rst [new file with mode: 0644]
Misc/stable_abi.toml
Modules/_testcapi/list.c
Objects/listobject.c
PC/python3dll.c