]> granicus.if.org Git - python/commitdiff
Issue 24017: Drop getawaitablefunc and friends in favor of unaryfunc.
authorYury Selivanov <yselivanov@sprymix.com>
Thu, 28 May 2015 15:21:31 +0000 (11:21 -0400)
committerYury Selivanov <yselivanov@sprymix.com>
Thu, 28 May 2015 15:21:31 +0000 (11:21 -0400)
Doc/c-api/typeobj.rst
Include/object.h
Modules/_testcapimodule.c
Objects/genobject.c
Python/ceval.c

index 6213d127c45b35bafd11d864925bed47d930d7d6..37dc6358723da83c0bdbad43c1315a8273d50328 100644 (file)
@@ -1357,12 +1357,12 @@ Async Object Structures
    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 @@ Async Object Structures
 
    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 @@ Async Object Structures
    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::
 
index e1734386c67886024e518366f29165142d21e1d2..8afcbe96dc7926c2c72109d08f45753518c9b668 100644 (file)
@@ -173,9 +173,6 @@ 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 */
@@ -305,9 +302,9 @@ typedef struct {
 } PyMappingMethods;
 
 typedef struct {
-    getawaitablefunc am_await;
-    getaiterfunc am_aiter;
-    aiternextfunc am_anext;
+    unaryfunc am_await;
+    unaryfunc am_aiter;
+    unaryfunc am_anext;
 } PyAsyncMethods;
 
 typedef struct {
index 19676866241f2e576d897681978f416d25b33ffc..2697ac243340c1115e67b63041834df8d324889a 100644 (file)
@@ -3987,7 +3987,7 @@ awaitObject_await(awaitObject *ao)
 }
 
 static PyAsyncMethods awaitType_as_async = {
-    (getawaitablefunc)awaitObject_await,    /* am_await */
+    (unaryfunc)awaitObject_await,           /* am_await */
     0,                                      /* am_aiter */
     0                                       /* am_anext */
 };
index 8e5624d460d71584e8cc2b34ea8fd4fccdd878a2..5d3b66c6ec4cca472581ce6379f59d0cfd035bfc 100644 (file)
@@ -708,7 +708,7 @@ PyGen_NeedsFinalizing(PyGenObject *gen)
 PyObject *
 _PyGen_GetAwaitableIter(PyObject *o)
 {
-    getawaitablefunc getter = NULL;
+    unaryfunc getter = NULL;
     PyTypeObject *ot;
 
     if (PyGen_CheckCoroutineExact(o)) {
index afb0f89aa8d0485c2d37a9d0c6d8485a20ed2fb4..7d39d9bfea99f430fa2139d4f128897ee3d9b0c1 100644 (file)
@@ -1927,7 +1927,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
         }
 
         TARGET(GET_AITER) {
-            getaiterfunc getter = NULL;
+            unaryfunc getter = NULL;
             PyObject *iter = NULL;
             PyObject *awaitable = NULL;
             PyObject *obj = TOP();
@@ -1974,7 +1974,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
         }
 
         TARGET(GET_ANEXT) {
-            aiternextfunc getter = NULL;
+            unaryfunc getter = NULL;
             PyObject *next_iter = NULL;
             PyObject *awaitable = NULL;
             PyObject *aiter = TOP();