@@ -188,7 +188,8 @@ All subgenerator delegation semantics are retained.
188188
1891891. :meth: `~object.__aiter__ ` is called to retrieve the asynchronous
190190 generator iterator.
191- 2. :meth: `~agen.asend ` is called to advance the asynchronous generator.
191+ 2. :meth: `~agen.asend ` is called to advance the asynchronous generato
192+ iterator.
192193
193194``async yield from `` is only allowed in an asynchronous generator function;
194195using it elsewhere will raise a :exc: `SyntaxError `.
@@ -203,7 +204,7 @@ In an asynchronous generator, ``async yield from`` is conceptually equivalent to
203204 ``async yield from `` retains all the subgenerator delegation behavior present
204205in standard ``yield from `` expressions. This behavior is outlined in :pep: `380 `
205206and :ref: `the documentation <yieldexpr >`. In short, values passed with
206- :meth: `~generator.send ` and exceptions supplied with :meth: `~generator.throw `
207+ :meth: `~agen.asend ` and exceptions supplied with :meth: `~agen.athrow `
207208are also passed to the target generator.
208209
209210
@@ -288,11 +289,12 @@ intends to be very intuitive; users should be able to deduce the behavior of
288289``yield from `` in an asynchronous generator based on their own background
289290knowledge of ``yield from `` in synchronous generators.
290291
292+
291293Potential footguns
292294------------------
293295
294- Forgetting to ``await `` before `` yield from ``
295- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
296+ Forgetting to ``await `` a future
297+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
296298
297299In :mod: `asyncio `, a :ref: `future <asyncio-future-obj >` object is natively
298300iterable. This means that if one were trying to iterate over the result of a
@@ -340,9 +342,7 @@ Acknowledgements
340342================
341343
342344Thanks to Bartosz Sławecki for aiding in the development of the reference
343- implementation of this PEP.
344-
345- In the reference implementation of this proposal, the :exc: `StopAsyncIteration `
345+ implementation of this PEP. In addition, the :exc: `StopAsyncIteration `
346346changes in addition to the support for non-``None `` return values inside
347347asynchronous generators were largely based on Alex Dixon's design from
348348`python/cpython#125401 <https://github.com/python/cpython/pull/125401 >`_
0 commit comments