diff options
Diffstat (limited to 'Include/genobject.h')
-rw-r--r-- | Include/genobject.h | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/Include/genobject.h b/Include/genobject.h index 7488054c68..e965334a01 100644 --- a/Include/genobject.h +++ b/Include/genobject.h @@ -9,6 +9,7 @@ extern "C" { #endif #include "pystate.h" /* _PyErr_StackItem */ +#include "abstract.h" /* PySendResult */ /* _PyGenObject_HEAD defines the initial segment of generator and coroutine objects. */ @@ -41,25 +42,9 @@ PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(PyFrameObject *, PyObject *name, PyObject *qualname); PyAPI_FUNC(int) _PyGen_SetStopIterationValue(PyObject *); PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **); -PyAPI_FUNC(PyObject *) _PyGen_Send(PyGenObject *, PyObject *); PyObject *_PyGen_yf(PyGenObject *); PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self); -typedef enum { - PYGEN_RETURN = 0, - PYGEN_ERROR = -1, - PYGEN_NEXT = 1, -} PySendResult; - -/* Sends the value into the generator or the coroutine. 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) PyGen_Send(PyGenObject *, PyObject *, PyObject **); - #ifndef Py_LIMITED_API typedef struct { _PyGenObject_HEAD(cr) |