From d3865574a93b6cb6c712829c51af5b6f9d4e9e76 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 2 Jul 2018 23:34:18 +0200 Subject: [PATCH] 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. --- stdlib/3.4/asyncio/__init__.pyi | 1 - stdlib/3.4/asyncio/tasks.pyi | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/3.4/asyncio/__init__.pyi b/stdlib/3.4/asyncio/__init__.pyi index ebd0bb289..6650910ea 100644 --- a/stdlib/3.4/asyncio/__init__.pyi +++ b/stdlib/3.4/asyncio/__init__.pyi @@ -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, diff --git a/stdlib/3.4/asyncio/tasks.pyi b/stdlib/3.4/asyncio/tasks.pyi index 12bba7e80..15f5e2dbe 100644 --- a/stdlib/3.4/asyncio/tasks.pyi +++ b/stdlib/3.4/asyncio/tasks.pyi @@ -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]]: ...