bpo-42085: Introduce dedicated entry in PyAsyncMethods for sending values (#22780)

This commit is contained in:
Vladimir Matveev 2020-11-10 12:09:55 -08:00 committed by GitHub
parent e59b2deffd
commit 1e996c3a3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 146 additions and 49 deletions

View file

@ -199,6 +199,8 @@ sub-slots
+---------------------------------------------------------+-----------------------------------+--------------+
| :c:member:`~PyAsyncMethods.am_anext` | :c:type:`unaryfunc` | __anext__ |
+---------------------------------------------------------+-----------------------------------+--------------+
| :c:member:`~PyAsyncMethods.am_send` | :c:type:`sendfunc` | |
+---------------------------------------------------------+-----------------------------------+--------------+
| |
+---------------------------------------------------------+-----------------------------------+--------------+
| :c:member:`~PyNumberMethods.nb_add` | :c:type:`binaryfunc` | __add__ |
@ -2304,6 +2306,7 @@ Async Object Structures
unaryfunc am_await;
unaryfunc am_aiter;
unaryfunc am_anext;
sendfunc am_send;
} PyAsyncMethods;
.. c:member:: unaryfunc PyAsyncMethods.am_await
@ -2337,6 +2340,15 @@ Async Object Structures
Must return an :term:`awaitable` object. See :meth:`__anext__` for details.
This slot may be set to ``NULL``.
.. c:member:: sendfunc PyAsyncMethods.am_send
The signature of this function is::
PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);
See :c:func:`PyIter_Send` for details.
This slot may be set to ``NULL``.
.. _slot-typedefs:
@ -2432,6 +2444,10 @@ Slot Type typedefs
.. c:type:: PyObject *(*binaryfunc)(PyObject *, PyObject *)
.. c:type:: PySendResult (*sendfunc)(PyObject *, PyObject *, PyObject **)
See :c:member:`~PyAsyncMethods.am_send`.
.. c:type:: PyObject *(*ternaryfunc)(PyObject *, PyObject *, PyObject *)
.. c:type:: PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t)