[Python-Dev] async/await in Python; v2
Greg Ewing
greg.ewing at canterbury.ac.nz
Thu Apr 23 11:16:55 CEST 2015
Yury Selivanov wrote:
> So how would we do "await fut" if await requires parentheses?
I've answered this with respect to PEP 3152 -- futures would
implement __cocall__, so you would write 'cocall fut()'.
I'm not sure what to say about PEP 492 here, because it
depends on exactly what a version of await that "requires
parentheses" would mean. It's not clear to me what you
have in mind for that from what you've said so far.
I'm not really in favour of just tweaking the existing PEP
492 notion of await so that it superficially resembles a
PEP 3152 cocall. That misses the point, which is that a
cocall is a special kind of function call, not a special
kind of yield-from.
--
Greg
More information about the Python-Dev
mailing list