mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	Issue 24017: Drop getawaitablefunc and friends in favor of unaryfunc.
This commit is contained in:
		
							parent
							
								
									6076a385e3
								
							
						
					
					
						commit
						6ef059097c
					
				
					 5 changed files with 13 additions and 16 deletions
				
			
		|  | @ -1357,12 +1357,12 @@ Async Object Structures | ||||||
|    Here is the structure definition:: |    Here is the structure definition:: | ||||||
| 
 | 
 | ||||||
|         typedef struct { |         typedef struct { | ||||||
|             getawaitablefunc am_await; |             unaryfunc am_await; | ||||||
|             getaiterfunc am_aiter; |             unaryfunc am_aiter; | ||||||
|             aiternextfunc am_anext; |             unaryfunc am_anext; | ||||||
|         } PyAsyncMethods; |         } PyAsyncMethods; | ||||||
| 
 | 
 | ||||||
| .. c:member:: getawaitablefunc PyAsyncMethods.am_await | .. c:member:: unaryfunc PyAsyncMethods.am_await | ||||||
| 
 | 
 | ||||||
|    The signature of this function is:: |    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`. |    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:: |    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 |    This slot may be set to *NULL* if an object does not implement | ||||||
|    asynchronous iteration protocol. |    asynchronous iteration protocol. | ||||||
| 
 | 
 | ||||||
| .. c:member:: aiternextfunc PyAsyncMethods.am_anext | .. c:member:: unaryfunc PyAsyncMethods.am_anext | ||||||
| 
 | 
 | ||||||
|    The signature of this function is:: |    The signature of this function is:: | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -173,9 +173,6 @@ typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t); | ||||||
| typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *); | typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *); | ||||||
| typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); | typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *); | ||||||
| typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *); | typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *); | ||||||
| typedef PyObject *(*getawaitablefunc) (PyObject *); |  | ||||||
| typedef PyObject *(*getaiterfunc) (PyObject *); |  | ||||||
| typedef PyObject *(*aiternextfunc) (PyObject *); |  | ||||||
| 
 | 
 | ||||||
| #ifndef Py_LIMITED_API | #ifndef Py_LIMITED_API | ||||||
| /* buffer interface */ | /* buffer interface */ | ||||||
|  | @ -305,9 +302,9 @@ typedef struct { | ||||||
| } PyMappingMethods; | } PyMappingMethods; | ||||||
| 
 | 
 | ||||||
| typedef struct { | typedef struct { | ||||||
|     getawaitablefunc am_await; |     unaryfunc am_await; | ||||||
|     getaiterfunc am_aiter; |     unaryfunc am_aiter; | ||||||
|     aiternextfunc am_anext; |     unaryfunc am_anext; | ||||||
| } PyAsyncMethods; | } PyAsyncMethods; | ||||||
| 
 | 
 | ||||||
| typedef struct { | typedef struct { | ||||||
|  |  | ||||||
|  | @ -3987,7 +3987,7 @@ awaitObject_await(awaitObject *ao) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static PyAsyncMethods awaitType_as_async = { | static PyAsyncMethods awaitType_as_async = { | ||||||
|     (getawaitablefunc)awaitObject_await,    /* am_await */ |     (unaryfunc)awaitObject_await,           /* am_await */ | ||||||
|     0,                                      /* am_aiter */ |     0,                                      /* am_aiter */ | ||||||
|     0                                       /* am_anext */ |     0                                       /* am_anext */ | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | @ -708,7 +708,7 @@ PyGen_NeedsFinalizing(PyGenObject *gen) | ||||||
| PyObject * | PyObject * | ||||||
| _PyGen_GetAwaitableIter(PyObject *o) | _PyGen_GetAwaitableIter(PyObject *o) | ||||||
| { | { | ||||||
|     getawaitablefunc getter = NULL; |     unaryfunc getter = NULL; | ||||||
|     PyTypeObject *ot; |     PyTypeObject *ot; | ||||||
| 
 | 
 | ||||||
|     if (PyGen_CheckCoroutineExact(o)) { |     if (PyGen_CheckCoroutineExact(o)) { | ||||||
|  |  | ||||||
|  | @ -1927,7 +1927,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         TARGET(GET_AITER) { |         TARGET(GET_AITER) { | ||||||
|             getaiterfunc getter = NULL; |             unaryfunc getter = NULL; | ||||||
|             PyObject *iter = NULL; |             PyObject *iter = NULL; | ||||||
|             PyObject *awaitable = NULL; |             PyObject *awaitable = NULL; | ||||||
|             PyObject *obj = TOP(); |             PyObject *obj = TOP(); | ||||||
|  | @ -1974,7 +1974,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         TARGET(GET_ANEXT) { |         TARGET(GET_ANEXT) { | ||||||
|             aiternextfunc getter = NULL; |             unaryfunc getter = NULL; | ||||||
|             PyObject *next_iter = NULL; |             PyObject *next_iter = NULL; | ||||||
|             PyObject *awaitable = NULL; |             PyObject *awaitable = NULL; | ||||||
|             PyObject *aiter = TOP(); |             PyObject *aiter = TOP(); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yury Selivanov
						Yury Selivanov