[Python-ideas] async objects

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Oct 6 19:40:50 EDT 2016


Nick Coghlan wrote:
> When a language usage pattern is supported for that long, but folks
> still don't grok how it might benefit them, you have a UX problem, and
> one of the ways to address it is to take the existing pattern and give
> it dedicated syntax, which is exactly what PEP 492 did.

However, it was just replacing one way of explicitly
marking suspension points ("yield from") with another
("await"). The fact that suspension points are explicitly
marked was driven by the implementation from the beginning.

When I first proposed "yield from" as an aid to using
generators as coroutines, my intention was always to
eventually replace it with something else. PEP 3152 was
my proposal for what the something else might be.
I initially regarded it as a wart that it still
required a special syntax for suspendable calls, and
felt the need to apologise for that.

I was totally surprised when people said they actually
*liked* the idea of explicit suspension points.

-- 
Greg


More information about the Python-ideas mailing list