Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

await vs yield from for python

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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?

>Solution :

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

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading