diff --git a/stdlib/3.4/asyncio/events.pyi b/stdlib/3.4/asyncio/events.pyi index bcac004cb..afdd6397e 100644 --- a/stdlib/3.4/asyncio/events.pyi +++ b/stdlib/3.4/asyncio/events.pyi @@ -1,4 +1,4 @@ -from typing import Any, Awaitable, TypeVar, List, Callable, Tuple, Union, Dict +from typing import Any, Awaitable, TypeVar, List, Callable, Tuple, Union, Dict, Generator from abc import ABCMeta, abstractmethod from asyncio.futures import Future @@ -34,7 +34,7 @@ class AbstractEventLoop(metaclass=ABCMeta): @abstractmethod def run_forever(self) -> None: ... @abstractmethod - def run_until_complete(self, future: Union[Awaitable[_T], Future[_T]]) -> _T: ... + def run_until_complete(self, future: Union[Awaitable[_T], Future[_T], Generator[Any, Any, _T]]) -> _T: ... @abstractmethod def stop(self) -> None: ... @abstractmethod diff --git a/stdlib/3.4/asyncio/tasks.pyi b/stdlib/3.4/asyncio/tasks.pyi index 9d5dc7aa2..3adebe1ba 100644 --- a/stdlib/3.4/asyncio/tasks.pyi +++ b/stdlib/3.4/asyncio/tasks.pyi @@ -1,4 +1,4 @@ -from typing import Any, Iterable, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic, Callable +from typing import Any, Iterable, TypeVar, Set, Dict, List, TextIO, Union, Tuple, Generic, Callable, Generator from asyncio.events import AbstractEventLoop from asyncio.futures import Future # __all__ = ['iscoroutinefunction', 'iscoroutine', @@ -18,7 +18,7 @@ def coroutine(f: _T) -> _T: ... # Here comes and go a function def sleep(delay: float, result: _T = ..., loop: AbstractEventLoop = ...) -> Future[_T]: ... def wait(fs: List[Task[_T]], *, loop: AbstractEventLoop = ..., timeout: float = ..., return_when: str = ...) -> Future[Tuple[Set[Future[_T]], Set[Future[_T]]]]: ... -def wait_for(fut: Future[_T], timeout: float, *, loop: AbstractEventLoop = ...) -> Future[_T]: ... +def wait_for(fut: Union[Future[_T], Generator[Any, None, _T]], timeout: float, *, loop: AbstractEventLoop = ...) -> Future[_T]: ... class Task(Future[_T], Generic[_T]): @@ -28,7 +28,7 @@ class Task(Future[_T], Generic[_T]): def current_task(cls, loop: AbstractEventLoop = ...) -> Task: ... @classmethod def all_tasks(cls, loop: AbstractEventLoop = ...) -> Set[Task]: ... - def __init__(self, coro: Future[_T], *, loop: AbstractEventLoop = ...) -> None: ... + def __init__(self, coro: Union[Future[_T], Generator[Any, None, _T]], *, loop: AbstractEventLoop = ...) -> None: ... def __repr__(self) -> str: ... def get_stack(self, *, limit: int = ...) -> List[Any]: ... # return List[stackframe] def print_stack(self, *, limit: int = ..., file: TextIO = ...) -> None: ...