changeset: 96333:99dcca3466d3 parent: 96331:9c0a00247021 parent: 96332:dfa0288c91fd user: Yury Selivanov date: Thu May 28 11:22:41 2015 -0400 description: Issue 24017: Drop getawaitablefunc and friends in favor of unaryfunc. diff -r 9c0a00247021 -r 99dcca3466d3 Doc/c-api/typeobj.rst --- a/Doc/c-api/typeobj.rst Thu May 28 10:53:04 2015 -0400 +++ b/Doc/c-api/typeobj.rst Thu May 28 11:22:41 2015 -0400 @@ -1357,12 +1357,12 @@ Here is the structure definition:: typedef struct { - getawaitablefunc am_await; - getaiterfunc am_aiter; - aiternextfunc am_anext; + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; } PyAsyncMethods; -.. c:member:: getawaitablefunc PyAsyncMethods.am_await +.. c:member:: unaryfunc PyAsyncMethods.am_await The signature of this function is:: @@ -1373,7 +1373,7 @@ This slot may be set to *NULL* if an object is not an :term:`awaitable`. -.. c:member:: getaiterfunc PyAsyncMethods.am_aiter +.. c:member:: unaryfunc PyAsyncMethods.am_aiter The signature of this function is:: @@ -1384,7 +1384,7 @@ This slot may be set to *NULL* if an object does not implement asynchronous iteration protocol. -.. c:member:: aiternextfunc PyAsyncMethods.am_anext +.. c:member:: unaryfunc PyAsyncMethods.am_anext The signature of this function is:: diff -r 9c0a00247021 -r 99dcca3466d3 Include/object.h --- a/Include/object.h Thu May 28 10:53:04 2015 -0400 +++ b/Include/object.h Thu May 28 11:22:41 2015 -0400 @@ -173,9 +173,6 @@ 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 */ @@ -305,9 +302,9 @@ } PyMappingMethods; typedef struct { - getawaitablefunc am_await; - getaiterfunc am_aiter; - aiternextfunc am_anext; + unaryfunc am_await; + unaryfunc am_aiter; + unaryfunc am_anext; } PyAsyncMethods; typedef struct { diff -r 9c0a00247021 -r 99dcca3466d3 Modules/_testcapimodule.c --- a/Modules/_testcapimodule.c Thu May 28 10:53:04 2015 -0400 +++ b/Modules/_testcapimodule.c Thu May 28 11:22:41 2015 -0400 @@ -3987,7 +3987,7 @@ } static PyAsyncMethods awaitType_as_async = { - (getawaitablefunc)awaitObject_await, /* am_await */ + (unaryfunc)awaitObject_await, /* am_await */ 0, /* am_aiter */ 0 /* am_anext */ }; diff -r 9c0a00247021 -r 99dcca3466d3 Objects/genobject.c --- a/Objects/genobject.c Thu May 28 10:53:04 2015 -0400 +++ b/Objects/genobject.c Thu May 28 11:22:41 2015 -0400 @@ -708,7 +708,7 @@ PyObject * _PyGen_GetAwaitableIter(PyObject *o) { - getawaitablefunc getter = NULL; + unaryfunc getter = NULL; PyTypeObject *ot; if (PyGen_CheckCoroutineExact(o)) { diff -r 9c0a00247021 -r 99dcca3466d3 Python/ceval.c --- a/Python/ceval.c Thu May 28 10:53:04 2015 -0400 +++ b/Python/ceval.c Thu May 28 11:22:41 2015 -0400 @@ -1927,7 +1927,7 @@ } TARGET(GET_AITER) { - getaiterfunc getter = NULL; + unaryfunc getter = NULL; PyObject *iter = NULL; PyObject *awaitable = NULL; PyObject *obj = TOP(); @@ -1974,7 +1974,7 @@ } TARGET(GET_ANEXT) { - aiternextfunc getter = NULL; + unaryfunc getter = NULL; PyObject *next_iter = NULL; PyObject *awaitable = NULL; PyObject *aiter = TOP();