[3.12] gh-121970: Replace .. coroutine{method,function} with :async: (GH-130448) (#130467)

(cherry picked from commit 5ec4bf86b7)

Co-authored-by: sobolevn <mail@sobolevn.me>
This commit is contained in:
Adam Turner 2025-02-22 18:22:29 +00:00 committed by GitHub
parent 6c59ea6f14
commit 9bd92fa241
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 187 additions and 140 deletions

View file

@ -745,7 +745,8 @@ which are used to control the execution of a generator function.
.. index:: pair: exception; StopAsyncIteration
.. coroutinemethod:: agen.__anext__()
.. method:: agen.__anext__()
:async:
Returns an awaitable which when run starts to execute the asynchronous
generator or resumes it at the last executed yield expression. When an
@ -762,7 +763,8 @@ which are used to control the execution of a generator function.
This method is normally called implicitly by a :keyword:`async for` loop.
.. coroutinemethod:: agen.asend(value)
.. method:: agen.asend(value)
:async:
Returns an awaitable which when run resumes the execution of the
asynchronous generator. As with the :meth:`~generator.send` method for a
@ -777,8 +779,9 @@ which are used to control the execution of a generator function.
because there is no yield expression that could receive the value.
.. coroutinemethod:: agen.athrow(value)
agen.athrow(type[, value[, traceback]])
.. method:: agen.athrow(value)
agen.athrow(type[, value[, traceback]])
:async:
Returns an awaitable that raises an exception of type ``type`` at the point
where the asynchronous generator was paused, and returns the next value
@ -798,7 +801,8 @@ which are used to control the execution of a generator function.
.. index:: pair: exception; GeneratorExit
.. coroutinemethod:: agen.aclose()
.. method:: agen.aclose()
:async:
Returns an awaitable that when run will throw a :exc:`GeneratorExit` into
the asynchronous generator function at the point where it was paused.