summaryrefslogtreecommitdiffstats
path: root/Doc/whatsnew
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2024-02-02 13:03:15 (GMT)
committerGitHub <noreply@github.com>2024-02-02 13:03:15 (GMT)
commitd0f1307580a69372611d27b04bbf2551dc85a1ef (patch)
treec690e6915eb44d57fc8af1623dc57babe3eca3ab /Doc/whatsnew
parent0e71a295e9530c939a5efcb45db23cf31e0303b4 (diff)
downloadcpython-d0f1307580a69372611d27b04bbf2551dc85a1ef.zip
cpython-d0f1307580a69372611d27b04bbf2551dc85a1ef.tar.gz
cpython-d0f1307580a69372611d27b04bbf2551dc85a1ef.tar.bz2
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()`.
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r--Doc/whatsnew/3.13.rst4
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.13.rst b/Doc/whatsnew/3.13.rst
index 887c300..f17c6ec 100644
--- a/Doc/whatsnew/3.13.rst
+++ b/Doc/whatsnew/3.13.rst
@@ -1376,6 +1376,10 @@ New Features
UTF-8 encoded bytes string, rather than a :c:expr:`PyObject*`.
(Contributed by Victor Stinner in :gh:`108314`.)
+* Added :c:func:`PyList_GetItemRef` function: similar to
+ :c:func:`PyList_GetItem` but returns a :term:`strong reference` instead of
+ a :term:`borrowed reference`.
+
* Add :c:func:`Py_IsFinalizing` function: check if the main Python interpreter is
:term:`shutting down <interpreter shutdown>`.
(Contributed by Victor Stinner in :gh:`108014`.)