[Python-Dev] Importance of "async" keyword

Ethan Furman ethan at stoneleaf.us
Fri Jun 26 16:20:48 CEST 2015

On 06/26/2015 06:48 AM, Sven R. Kunze wrote:

> def business():
>      return complex_calc(5)
> def business_new()
>      return await complex_calc(10)

> Maybe, I completely missed the point of the proposal, but this is the way I would expect it to work. Putting in an 'await' whenever I see fit and it just works.

Sadly, I have basically no experience in this area -- perhaps that's why Sven's arguments make sense to me.  ;)

As Nick said earlier: the caller always blocks; by extension (to my mind, at least) putting an `await` in front of something is saying, "it's okay if other tasks run while I'm blocking on this call."

Maybe we can get there someday.


More information about the Python-Dev mailing list