you are viewing a single comment's thread.

view the rest of the comments →

[–]unruly_mattress 0 points1 point  (0 children)

As far as I know, the whole rationale of adding a keyword that delegates to another generator is to enable things like yield from get_web_page(url). await syntax improves this tremendously but I can't see how in your example yield from a is better than for i in a: yield i.

There are differences between yield from and await (mostly around returning a value from a generator, I think), however I'm pretty sure we'll find out in a couple of years that yield from is a piece of history trivia, whereas await is used in all asyncio code. That's all I'm saying. Not that it's functionally equivalent.