[Python-ideas] async objects

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Oct 6 03:45:42 EDT 2016


Nathaniel Smith wrote:
> It wasn't that we created these keywords to solve some
> implementation problem and then inflicted them on users.

I disagree -- looking at the history of how we
ended up with async/await, it looks to me like
this is exactly what *did* happen.

First we had generators. Then 'yield from' was
invented to (among other things) leverage them as
a way of getting lightweight threads. Then 'await'
was introduced as a nicer way to spell 'yield from'
when using it for that purpose.

Saying that 'await' is good for you because it
makes the suspension points visible seems to me
a rationalisation after the fact. It was something
that emerged from the implementation, not a
prior design requirement.

-- 
Greg


More information about the Python-ideas mailing list