summaryrefslogtreecommitdiff
path: root/Include/genobject.h
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-05-11 22:57:16 -0400
committerYury Selivanov <yselivanov@sprymix.com>2015-05-11 22:57:16 -0400
commit7544508f0245173bff5866aa1598c8f6cce1fc5f (patch)
treebf80850d9cd46fc811f04b8c2484fb50775c697d /Include/genobject.h
parent4e6bf4b3da03b132b0698f30ee931a350585b117 (diff)
downloadcpython-git-7544508f0245173bff5866aa1598c8f6cce1fc5f.tar.gz
PEP 0492 -- Coroutines with async and await syntax. Issue #24017.
Diffstat (limited to 'Include/genobject.h')
-rw-r--r--Include/genobject.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/Include/genobject.h b/Include/genobject.h
index 23571e663b..ee0b1305a7 100644
--- a/Include/genobject.h
+++ b/Include/genobject.h
@@ -38,6 +38,12 @@ PyAPI_DATA(PyTypeObject) PyGen_Type;
#define PyGen_Check(op) PyObject_TypeCheck(op, &PyGen_Type)
#define PyGen_CheckExact(op) (Py_TYPE(op) == &PyGen_Type)
+#define PyGen_CheckCoroutineExact(op) (PyGen_CheckExact(op) && \
+ (((PyCodeObject*) \
+ ((PyGenObject*)op)->gi_code) \
+ ->co_flags & (CO_ITERABLE_COROUTINE | \
+ CO_COROUTINE)))
+
PyAPI_FUNC(PyObject *) PyGen_New(struct _frame *);
PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(struct _frame *,
PyObject *name, PyObject *qualname);
@@ -46,6 +52,7 @@ PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **);
PyObject *_PyGen_Send(PyGenObject *, PyObject *);
PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self);
+PyObject *_PyGen_GetAwaitableIter(PyObject *o);
#ifdef __cplusplus
}