Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Hi! I'm the author of this post. I've been writing asynchronous Python code with async/await for quite a while but didn't have a perfect understanding of how it actually works: what await does; what an event loop really is and how it runs coroutines; what coroutines are; why Python has native coroutines as well as generator-based coroutines; how asyncio works; and so forth... In this post I've tried to answer all these questions. After reading it, you should be able to reason about async/await code almost as easily as you reason about regular Python code.

If you liked this post, you may also like other posts in my Python behind the scenes series: https://tenthousandmeters.com/tag/python-behind-the-scenes/

As always, I welcome your feedback and questions. Thanks!



Fantastic read thank you very much!

It's really hard to find in depth articles like this nowadays.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: