Yury Selivanov added the comment:

New patch is attached.

Nick, I think that all of your feedback should be addressed in this patch.

Major changes:

1. There are two code flags now: CO_COROUTINE and CO_GENBASED_COROUTINE (I'm OK 
to use another name, see my older comments).  CO_COROUTINE is assigned to all 
'async def' code objects.  CO_GENBASED_COROUTINE is assigned to generator-based 
coroutines decorated with types.coroutine().

2. tp_await renamed to tp_as_async. (I'm OK to use another name, please see my 
older comment first) PyAsyncMethods struct holds three slots: am_await, 
am_aiter, am_anext.  Implementing am_exit would be tricky, because of how 
SETUP_WITH opcode is engineered.  I'd really prefer to not to add it.

3. collections.abc.Coroutine.

4. etc (all other feedback from you).

Added file: http://bugs.python.org/file39337/await_05.patch

Python tracker <rep...@bugs.python.org>
Python-bugs-list mailing list

Reply via email to