bpo-41756: Add PyIter_Send function (#22443)
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``.