diff options
Diffstat (limited to 'Include/abstract.h')
-rw-r--r-- | Include/abstract.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Include/abstract.h b/Include/abstract.h index a23b7dc78f..28e576b929 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -338,6 +338,24 @@ 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, + PYGEN_NEXT = 1, +} PySendResult; + +/* Takes generator, coroutine or iterator object and sends the value into it. + Returns: + - PYGEN_RETURN (0) if generator has returned. + 'result' parameter is filled with return value + - PYGEN_ERROR (-1) if exception was raised. + 'result' parameter is NULL + - 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 ================================================== */ |