summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYury Selivanov <yselivanov@sprymix.com>2015-05-28 15:22:41 (GMT)
committerYury Selivanov <yselivanov@sprymix.com>2015-05-28 15:22:41 (GMT)
commitac0bffb96207182f6566e382b7d053a471c2d1fa (patch)
tree135595486ee3813d5e551c95f8bb532f78b6199b
parentee941b0278d6ea69d01f84e2c69cb8024e8a01bd (diff)
parent6ef059097cdfc9ee4c5a5292db5c9d5a5be2f97c (diff)
downloadcpython-ac0bffb96207182f6566e382b7d053a471c2d1fa.zip
cpython-ac0bffb96207182f6566e382b7d053a471c2d1fa.tar.gz
cpython-ac0bffb96207182f6566e382b7d053a471c2d1fa.tar.bz2
Issue 24017: Drop getawaitablefunc and friends in favor of unaryfunc.
-rw-r--r--Doc/c-api/typeobj.rst12
-rw-r--r--Include/object.h9
-rw-r--r--Modules/_testcapimodule.c2
-rw-r--r--Objects/genobject.c2
-rw-r--r--Python/ceval.c4
5 files changed, 13 insertions, 16 deletions
diff --git a/Doc/c-api/typeobj.rst b/Doc/c-api/typeobj.rst
index 6213d12..37dc635 100644
--- a/Doc/c-api/typeobj.rst
+++ b/Doc/c-api/typeobj.rst
@@ -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::
diff --git a/Include/object.h b/Include/object.h
index e173438..8afcbe9 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -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 {
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 1967686..2697ac2 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -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 */
};
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 8e5624d..5d3b66c 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -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)) {
diff --git a/Python/ceval.c b/Python/ceval.c
index afb0f89..7d39d9b 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -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();