Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6ef0590

Browse files
committed
Issue 24017: Drop getawaitablefunc and friends in favor of unaryfunc.
1 parent 6076a38 commit 6ef0590

5 files changed

Lines changed: 13 additions & 16 deletions

File tree

Doc/c-api/typeobj.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,12 +1357,12 @@ Async Object Structures
13571357
Here is the structure definition::
13581358

13591359
typedef struct {
1360-
getawaitablefunc am_await;
1361-
getaiterfunc am_aiter;
1362-
aiternextfunc am_anext;
1360+
unaryfunc am_await;
1361+
unaryfunc am_aiter;
1362+
unaryfunc am_anext;
13631363
} PyAsyncMethods;
13641364

1365-
.. c:member:: getawaitablefunc PyAsyncMethods.am_await
1365+
.. c:member:: unaryfunc PyAsyncMethods.am_await
13661366
13671367
The signature of this function is::
13681368

@@ -1373,7 +1373,7 @@ Async Object Structures
13731373

13741374
This slot may be set to *NULL* if an object is not an :term:`awaitable`.
13751375

1376-
.. c:member:: getaiterfunc PyAsyncMethods.am_aiter
1376+
.. c:member:: unaryfunc PyAsyncMethods.am_aiter
13771377
13781378
The signature of this function is::
13791379

@@ -1384,7 +1384,7 @@ Async Object Structures
13841384
This slot may be set to *NULL* if an object does not implement
13851385
asynchronous iteration protocol.
13861386

1387-
.. c:member:: aiternextfunc PyAsyncMethods.am_anext
1387+
.. c:member:: unaryfunc PyAsyncMethods.am_anext
13881388
13891389
The signature of this function is::
13901390

Include/object.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,6 @@ typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t);
173173
typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *);
174174
typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
175175
typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *);
176-
typedef PyObject *(*getawaitablefunc) (PyObject *);
177-
typedef PyObject *(*getaiterfunc) (PyObject *);
178-
typedef PyObject *(*aiternextfunc) (PyObject *);
179176

180177
#ifndef Py_LIMITED_API
181178
/* buffer interface */
@@ -305,9 +302,9 @@ typedef struct {
305302
} PyMappingMethods;
306303

307304
typedef struct {
308-
getawaitablefunc am_await;
309-
getaiterfunc am_aiter;
310-
aiternextfunc am_anext;
305+
unaryfunc am_await;
306+
unaryfunc am_aiter;
307+
unaryfunc am_anext;
311308
} PyAsyncMethods;
312309

313310
typedef struct {

Modules/_testcapimodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3987,7 +3987,7 @@ awaitObject_await(awaitObject *ao)
39873987
}
39883988

39893989
static PyAsyncMethods awaitType_as_async = {
3990-
(getawaitablefunc)awaitObject_await, /* am_await */
3990+
(unaryfunc)awaitObject_await, /* am_await */
39913991
0, /* am_aiter */
39923992
0 /* am_anext */
39933993
};

Objects/genobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ PyGen_NeedsFinalizing(PyGenObject *gen)
708708
PyObject *
709709
_PyGen_GetAwaitableIter(PyObject *o)
710710
{
711-
getawaitablefunc getter = NULL;
711+
unaryfunc getter = NULL;
712712
PyTypeObject *ot;
713713

714714
if (PyGen_CheckCoroutineExact(o)) {

Python/ceval.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
19271927
}
19281928

19291929
TARGET(GET_AITER) {
1930-
getaiterfunc getter = NULL;
1930+
unaryfunc getter = NULL;
19311931
PyObject *iter = NULL;
19321932
PyObject *awaitable = NULL;
19331933
PyObject *obj = TOP();
@@ -1974,7 +1974,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
19741974
}
19751975

19761976
TARGET(GET_ANEXT) {
1977-
aiternextfunc getter = NULL;
1977+
unaryfunc getter = NULL;
19781978
PyObject *next_iter = NULL;
19791979
PyObject *awaitable = NULL;
19801980
PyObject *aiter = TOP();

0 commit comments

Comments
 (0)