mirror of
https://github.com/python/cpython.git
synced 2025-08-23 10:16:01 +00:00
Issue #28544: Implement asyncio.Task in C.
This implementation provides additional 10-20% speed boost for asyncio programs. The patch also fixes _asynciomodule.c to use Arguments Clinic, and makes '_schedule_callbacks' an overridable method (as it was in 3.5).
This commit is contained in:
parent
bbcb79920b
commit
a0c1ba608e
10 changed files with 2717 additions and 557 deletions
|
@ -11,7 +11,7 @@ import types
|
|||
|
||||
from . import compat
|
||||
from . import events
|
||||
from . import futures
|
||||
from . import base_futures
|
||||
from .log import logger
|
||||
|
||||
|
||||
|
@ -204,7 +204,7 @@ def coroutine(func):
|
|||
@functools.wraps(func)
|
||||
def coro(*args, **kw):
|
||||
res = func(*args, **kw)
|
||||
if (futures.isfuture(res) or inspect.isgenerator(res) or
|
||||
if (base_futures.isfuture(res) or inspect.isgenerator(res) or
|
||||
isinstance(res, CoroWrapper)):
|
||||
res = yield from res
|
||||
elif _AwaitableABC is not None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue