diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-12 02:57:16 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-05-12 02:57:16 (GMT) |
commit | 7544508f0245173bff5866aa1598c8f6cce1fc5f (patch) | |
tree | bf80850d9cd46fc811f04b8c2484fb50775c697d /Include/object.h | |
parent | 4e6bf4b3da03b132b0698f30ee931a350585b117 (diff) | |
download | cpython-7544508f0245173bff5866aa1598c8f6cce1fc5f.zip cpython-7544508f0245173bff5866aa1598c8f6cce1fc5f.tar.gz cpython-7544508f0245173bff5866aa1598c8f6cce1fc5f.tar.bz2 |
PEP 0492 -- Coroutines with async and await syntax. Issue #24017.
Diffstat (limited to 'Include/object.h')
-rw-r--r-- | Include/object.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Include/object.h b/Include/object.h index 5716f66..e173438 100644 --- a/Include/object.h +++ b/Include/object.h @@ -173,6 +173,9 @@ typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t); typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *); typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *); +typedef PyObject *(*getawaitablefunc) (PyObject *); +typedef PyObject *(*getaiterfunc) (PyObject *); +typedef PyObject *(*aiternextfunc) (PyObject *); #ifndef Py_LIMITED_API /* buffer interface */ @@ -301,6 +304,11 @@ typedef struct { objobjargproc mp_ass_subscript; } PyMappingMethods; +typedef struct { + getawaitablefunc am_await; + getaiterfunc am_aiter; + aiternextfunc am_anext; +} PyAsyncMethods; typedef struct { getbufferproc bf_getbuffer; @@ -346,7 +354,7 @@ typedef struct _typeobject { printfunc tp_print; getattrfunc tp_getattr; setattrfunc tp_setattr; - void *tp_reserved; /* formerly known as tp_compare */ + PyAsyncMethods *tp_as_async; /* formerly known as tp_compare or tp_reserved */ reprfunc tp_repr; /* Method suites for standard classes */ @@ -453,6 +461,7 @@ typedef struct _heaptypeobject { /* Note: there's a dependency on the order of these members in slotptr() in typeobject.c . */ PyTypeObject ht_type; + PyAsyncMethods as_async; PyNumberMethods as_number; PyMappingMethods as_mapping; PySequenceMethods as_sequence; /* as_sequence comes after as_mapping, |