Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Doc/c-api/iter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ something like this::

The enum value used to represent different results of :c:func:`PyIter_Send`.

.. versionadded:: 3.10

Comment thread
serhiy-storchaka marked this conversation as resolved.

.. c:function:: PySendResult PyIter_Send(PyObject *iter, PyObject *arg, PyObject **presult)

Expand All @@ -58,3 +60,5 @@ something like this::
- ``PYGEN_RETURN`` if iterator returns. Return value is returned via *presult*.
- ``PYGEN_NEXT`` if iterator yields. Yielded value is returned via *presult*.
- ``PYGEN_ERROR`` if iterator has raised and exception. *presult* is set to ``NULL``.

.. versionadded:: 3.10
2 changes: 2 additions & 0 deletions Include/abstract.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ PyAPI_FUNC(int) PyIter_Check(PyObject *);
NULL with an exception means an error occurred. */
PyAPI_FUNC(PyObject *) PyIter_Next(PyObject *);

#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
typedef enum {
PYGEN_RETURN = 0,
PYGEN_ERROR = -1,
Expand All @@ -353,6 +354,7 @@ typedef enum {
- PYGEN_NEXT (1) if generator has yielded.
'result' parameter is filled with yielded value. */
PyAPI_FUNC(PySendResult) PyIter_Send(PyObject *, PyObject *, PyObject **);
#endif


/* === Number Protocol ================================================== */
Expand Down
1 change: 1 addition & 0 deletions PC/python3dll.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ EXPORT_FUNC(PyInterpreterState_GetID)
EXPORT_FUNC(PyInterpreterState_New)
EXPORT_FUNC(PyIter_Check)
EXPORT_FUNC(PyIter_Next)
EXPORT_FUNC(PyIter_Send)
EXPORT_FUNC(PyList_Append)
EXPORT_FUNC(PyList_AsTuple)
EXPORT_FUNC(PyList_GetItem)
Expand Down