pep-0492: Edits in PEP 3152 section
This commit is contained in:
parent
235a1e7f01
commit
4141a0644e
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue