mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
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>
This commit is contained in:
parent
540fcc62f5
commit
e006c7371d
12 changed files with 156 additions and 40 deletions
1
PC/python3dll.c
generated
1
PC/python3dll.c
generated
|
|
@ -326,6 +326,7 @@ EXPORT_FUNC(PyInterpreterState_GetID)
|
|||
EXPORT_FUNC(PyInterpreterState_New)
|
||||
EXPORT_FUNC(PyIter_Check)
|
||||
EXPORT_FUNC(PyIter_Next)
|
||||
EXPORT_FUNC(PyIter_NextItem)
|
||||
EXPORT_FUNC(PyIter_Send)
|
||||
EXPORT_FUNC(PyList_Append)
|
||||
EXPORT_FUNC(PyList_AsTuple)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue