File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -296,14 +296,15 @@ The only way to yield (or effectively cede control) from a coroutine is to
296296That might sound odd to you. Frankly, it was to me too. You might be thinking:
297297
298298 1. What about a ``yield `` directly within the coroutine? The coroutine becomes
299- a generator-coroutine, a different beast entirely.
299+ a generator-coroutine (or async generator) , a different beast entirely.
300300
301301 2. What about a ``yield from `` within the coroutine to a function that yields
302302 (that is, plain generator)?
303303 ``SyntaxError: yield from not allowed in a coroutine. ``
304- I imagine Python made this a ``SyntaxError `` to mandate only one way of using
305- coroutines for the sake of simplicity.
306- Ideologically, ``yield from `` and ``await `` are quite similar.
304+ This was intentionally designed for the sake of simplicity -- mandating only
305+ one way of using coroutines. Originally ``yield `` was actually barred as well,
306+ but was re-accepted to allow for async generators.
307+ Ideologically, ``yield from `` and ``await `` are very similar.
307308
308309=======
309310Futures
You can’t perform that action at this time.
0 commit comments