diff options
author | Erlend E. Aasland <erlend@python.org> | 2024-08-07 22:47:15 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-07 22:47:15 (GMT) |
commit | e006c7371d8e57db26254792c67292956e88d81d (patch) | |
tree | 7f3b7a2ced182afab89cb4c059445b8581762b6f /Doc/whatsnew | |
parent | 540fcc62f5da982b79504221cac01bfab8b73ba1 (diff) | |
download | cpython-e006c7371d8e57db26254792c67292956e88d81d.zip cpython-e006c7371d8e57db26254792c67292956e88d81d.tar.gz cpython-e006c7371d8e57db26254792c67292956e88d81d.tar.bz2 |
gh-105201: Add PyIter_NextItem() (#122331)
Return -1 and set an exception on error; return 0 if the iterator is
exhausted, and return 1 if the next item was fetched successfully.
Prefer this API to PyIter_Next(), which requires the caller to use
PyErr_Occurred() to differentiate between iterator exhaustion and errors.
Co-authered-by: Irit Katriel <iritkatriel@yahoo.com>
Diffstat (limited to 'Doc/whatsnew')
-rw-r--r-- | Doc/whatsnew/3.14.rst | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.14.rst b/Doc/whatsnew/3.14.rst index c989de2..b975f6a 100644 --- a/Doc/whatsnew/3.14.rst +++ b/Doc/whatsnew/3.14.rst @@ -404,6 +404,10 @@ New Features (Contributed by Victor Stinner in :gh:`119182`.) +* Add :c:func:`PyIter_NextItem` to replace :c:func:`PyIter_Next`, + which has an ambiguous return value. + (Contributed by Irit Katriel and Erlend Aasland in :gh:`105201`.) + Porting to Python 3.14 ---------------------- |