[Python-Dev] async/await in Python; v2 (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Wed Apr 22 08:05:19 CEST 2015


Yury Selivanov wrote:

1. COASYNC flag was renamed to COCOROUTINE;

2. sys.setasyncwrapper() was renamed to sys.setcoroutinewrapper(); 3. New function: sys.getcoroutinewrapper(); 4. types.asyncdef() renamed to types.coroutine();

I still don't like the idea of hijacking the generic term "coroutine" and using it to mean this particular type of object.

2. I propose to disallow using of 'for..in' loops, and builtins like 'list()', 'iter()', 'next()', 'tuple()' etc on coroutines.

PEP 3152 takes care of this automatically from the fact that you can't make an ordinary call to a cofunction, and cocall combines a call and a yield-from. You have to go out of your way to get hold of the underlying iterator to use in a for-loop, etc.

-- Greg



More information about the Python-Dev mailing list