Relax signature of gather() (#677)

Fixes #675
This commit is contained in:
Guido van Rossum
2016-11-10 10:55:29 -08:00
committed by GitHub
parent dfe4bf0a70
commit bf8b5ac5fd

View File

@@ -18,8 +18,10 @@ def as_completed(fs: Sequence[Future[_T]], *, loop: AbstractEventLoop = ...,
timeout=None) -> Iterator[Generator[Any, None, _T]]: ...
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]]: ...
# TODO: gather() should use variadic type vars instead of _TAny.
_TAny = Any
def gather(*coros_or_futures: Union[Future[_TAny], Generator[Any, None, _TAny], Awaitable[_TAny]],
loop: AbstractEventLoop = ..., return_exceptions: bool = False) -> Future[List[_TAny]]: ...
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]],