pep-0492: Edits in PEP 3152 section

This commit is contained in:
Yury Selivanov 2015-04-23 16:22:57 -04:00
parent 235a1e7f01
commit 4141a0644e
1 changed files with 4 additions and 5 deletions

View File

@ -731,11 +731,10 @@ Differences from this proposal:
3. To make asyncio work with PEP 3152 it would be required to modify
``@asyncio.coroutine`` decorator to wrap all functions in an object
with a ``__cocall__`` method. To call *cofunctions* from existing
generator-based coroutines it would be required to use ``costart``
built-in. In this proposal ``@asyncio.coroutine`` simply sets
``CO_COROUTINE`` on the wrapped function's code object and
everything works automatically.
with a ``__cocall__`` method, or to implement ``__cocall__`` on
generators. To call *cofunctions* from existing generator-based
coroutines it would be required to use ``costart(cofunc, *args,
**kwargs)`` built-in.
4. Since it is impossible to call a *cofunction* without a ``cocall``
keyword, it automatically prevents the common mistake of forgetting