mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
[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:
parent
6c59ea6f14
commit
9bd92fa241
10 changed files with 187 additions and 140 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue