From b476028df7b2d0febbc5444cd2f2ff267c525141 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 4 Nov 2016 14:49:49 -0700 Subject: [PATCH] Fix signature of run_coroutine_threadsafe() (#657) --- stdlib/3.4/asyncio/tasks.pyi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/stdlib/3.4/asyncio/tasks.pyi b/stdlib/3.4/asyncio/tasks.pyi index 320be9da3..cd18ba343 100644 --- a/stdlib/3.4/asyncio/tasks.pyi +++ b/stdlib/3.4/asyncio/tasks.pyi @@ -1,5 +1,7 @@ from typing import (Any, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic, Callable, - Generator, Iterable, Awaitable, overload, Sequence, Iterator, Optional) + Coroutine, Generator, Iterable, Awaitable, overload, Sequence, Iterator, + Optional) +import concurrent.futures __all__ = ... # type: str @@ -18,8 +20,8 @@ def ensure_future(coro_or_future: Union[Future[_T], Generator[Any, None, _T]], *, loop: AbstractEventLoop = ...) -> Future[_T]: ... def gather(*coros_or_futures: Union[Future[_T], Generator[Any, None, _T], Awaitable[_T]], loop: AbstractEventLoop = ..., return_exceptions: bool = False) -> Future[List[_T]]: ... -def run_coroutine_threadsafe(coro: Generator[Any, None, _T], - loop: AbstractEventLoop) -> Future[_T]: ... +def run_coroutine_threadsafe(coro: Union[Generator[Any, None, _T], Coroutine[Any, None, _T], Awaitable[_T]], + loop: AbstractEventLoop) -> concurrent.futures.Future[_T]: ... def shield(arg: Union[Future[_T], Generator[Any, None, _T]], *, loop: AbstractEventLoop = ...) -> Future[_T]: ... def sleep(delay: float, result: _T = ..., loop: AbstractEventLoop = ...) -> Future[_T]: ...