Hacker News new | past | comments | ask | show | jobs | submit login

Isn't the point that you should be using `def`, not `async def` here?



Yes. But this is a very basic example. When you have an async function defined with `await` statements in it and later on in the function you do a call to a `blocking` function you need to be aware that you have to run in the threadpool.

You don't always know that a function call is blocking, because you don't always know what is happening behind the scenes of that function and on what it depends.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: