1

https://stackoverflow.com/a/44273861/433570 says 'yield from' is old and we should learn 'await'.
But It doesn't say they are the same thing or they are different.

But I have some good book and videos which talks about yield from

Can I think yield from was replaced by await? and they are essentially the same thing?

https://www.youtube.com/watch?v=MCs5OvhV9S4

I have a book fluent python which also talks about yield from

  • Edit

When I see some good books/videos like the above talking about yield from, could I substitute yield from with await in my mind?

eugene
  • 36,347
  • 56
  • 224
  • 435
  • Does this answer your question? [What does the "yield from" syntax do in asyncio and how is it different from "await"](https://stackoverflow.com/questions/44251045/what-does-the-yield-from-syntax-do-in-asyncio-and-how-is-it-different-from-aw) – testfile Dec 30 '21 at 06:30
  • 1
    @testfile I even quoted the link in my op. It doesn't clearly say they are the same thing whether I can think of `await` as a new name for `yield from` – eugene Dec 30 '21 at 06:41

1 Answers1

1

Yes they are the same thing. Yield is the manual way of doing async await. See https://www.python.org/dev/peps/pep-0492/#new-coroutine-declaration-syntax where they detail that async await is just a coroutine (yield) underneath

testfile
  • 1,209
  • 10
  • 23