Remove asyncio.tasks.async (#2296)

While this alias for ensure_future existed prior to Python 3.7, it
causes a syntax error when parsing it with Python 3.7 or above.
This commit is contained in:
Sebastian Rittau
2018-07-02 23:34:18 +02:00
committed by Guido van Rossum
parent ce1504d9e9
commit d3865574a9
2 changed files with 2 additions and 2 deletions

View File

@@ -46,7 +46,6 @@ from asyncio.tasks import (
ALL_COMPLETED as ALL_COMPLETED,
as_completed as as_completed,
ensure_future as ensure_future,
async as async,
gather as gather,
run_coroutine_threadsafe as run_coroutine_threadsafe,
shield as shield,

View File

@@ -24,7 +24,8 @@ def as_completed(fs: Sequence[_FutureT[_T]], *, loop: AbstractEventLoop = ...,
timeout: Optional[float] = ...) -> Iterator[Generator[Any, None, _T]]: ...
def ensure_future(coro_or_future: _FutureT[_T],
*, loop: AbstractEventLoop = ...) -> Future[_T]: ...
async = ensure_future
# Prior to Python 3.7 'async' was an alias for 'ensure_future'.
# It became a keyword in 3.7.
@overload
def gather(coro_or_future1: _FutureT[_T1],
*, loop: AbstractEventLoop = ..., return_exceptions: bool = ...) -> Future[Tuple[_T1]]: ...