bpo-41756: Add PyIter_Send function (#22443)
diff --git a/Doc/c-api/gen.rst b/Doc/c-api/gen.rst
index e098425..600f534 100644
--- a/Doc/c-api/gen.rst
+++ b/Doc/c-api/gen.rst
@@ -15,11 +15,6 @@
The C structure used for generator objects.
-.. c:type:: PySendResult
-
- The enum value used to represent different results of :c:func:`PyGen_Send`.
-
-
.. c:var:: PyTypeObject PyGen_Type
The type object corresponding to generator objects.
diff --git a/Doc/c-api/iter.rst b/Doc/c-api/iter.rst
index a2992b3..a068a43 100644
--- a/Doc/c-api/iter.rst
+++ b/Doc/c-api/iter.rst
@@ -44,3 +44,17 @@
else {
/* continue doing useful work */
}
+
+
+.. c:type:: PySendResult
+
+ The enum value used to represent different results of :c:func:`PyIter_Send`.
+
+
+.. c:function:: PySendResult PyIter_Send(PyObject *iter, PyObject *arg, PyObject **presult)
+
+ Sends the *arg* value into the iterator *iter*. Returns:
+
+ - ``PYGEN_RETURN`` if iterator returns. Return value is returned via *presult*.
+ - ``PYGEN_NEXT`` if iterator yields. Yielded value is returned via *presult*.
+ - ``PYGEN_ERROR`` if iterator has raised and exception. *presult* is set to ``NULL``.