TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How async/await works in Python

37 pointsby r4victorover 3 years ago

4 comments

r4victorover 3 years ago
Hi! I&#x27;m the author of this post. I&#x27;ve been writing asynchronous Python code with async&#x2F;await for quite a while but didn&#x27;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&#x27;ve tried to answer all these questions. After reading it, you should be able to reason about async&#x2F;await code almost as easily as you reason about regular Python code.<p>If you liked this post, you may also like other posts in my Python behind the scenes series: <a href="https:&#x2F;&#x2F;tenthousandmeters.com&#x2F;tag&#x2F;python-behind-the-scenes&#x2F;" rel="nofollow">https:&#x2F;&#x2F;tenthousandmeters.com&#x2F;tag&#x2F;python-behind-the-scenes&#x2F;</a><p>As always, I welcome your feedback and questions. Thanks!
评论 #28403903 未加载
archibaldJover 3 years ago
Interesting to see this language feature being broken down in python. Just today I was looking at async&#x2F;await &amp; generator in js (and wrote a summary here <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;69055066" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;69055066</a> while still trying to wrap my head around redux-saga <a href="https:&#x2F;&#x2F;redux-saga.js.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;redux-saga.js.org&#x2F;</a>)<p>Haven’t done python for a while; was ‘t aware js &amp; python share such resemblances!
aiNohY6gover 3 years ago
Thanks, super interesting read!<p>Side note: I&#x27;ve been desperately looking for a simple, clear and practical &quot;getting started&quot; guide of async&#x2F;await in python. Any link you can recommend?
mcc1aneover 3 years ago
you lost me at &quot;subgenerators&quot;