diff --git a/stdlib/3.4/asyncio/__init__.pyi b/stdlib/3.4/asyncio/__init__.pyi index e22015e51..1b55d7064 100644 --- a/stdlib/3.4/asyncio/__init__.pyi +++ b/stdlib/3.4/asyncio/__init__.pyi @@ -1,9 +1,13 @@ """The asyncio package, tracking PEP 3156.""" +from asyncio.coroutines import ( + coroutine as coroutine, + iscoroutinefunction as iscoroutinefunction, + iscoroutine as iscoroutine, +) from asyncio.futures import ( Future as Future, ) from asyncio.tasks import ( - coroutine as coroutine, sleep as sleep, Task as Task, FIRST_COMPLETED as FIRST_COMPLETED, @@ -27,7 +31,8 @@ from asyncio.queues import ( QueueEmpty as QueueEmpty, ) -__all__ = (futures.__all__ + +__all__ = (coroutines.__all__ + + futures.__all__ + tasks.__all__ + events.__all__ + queues.__all__) diff --git a/stdlib/3.4/asyncio/coroutines.pyi b/stdlib/3.4/asyncio/coroutines.pyi new file mode 100644 index 000000000..ad0178a10 --- /dev/null +++ b/stdlib/3.4/asyncio/coroutines.pyi @@ -0,0 +1,8 @@ +from typing import Callable, Any + +__all__ = ['coroutine', + 'iscoroutinefunction', 'iscoroutine'] + +def coroutine(func: Callable[..., Any]) -> Callable[..., Any]: ... +def iscoroutinefunction(func: Callable[..., Any]) -> bool: ... +def iscoroutine(obj: Any) -> bool: ... diff --git a/stdlib/3.4/asyncio/queues.pyi b/stdlib/3.4/asyncio/queues.pyi index 720864aef..f945ab022 100644 --- a/stdlib/3.4/asyncio/queues.pyi +++ b/stdlib/3.4/asyncio/queues.pyi @@ -4,7 +4,7 @@ __all__ = ['Queue', 'PriorityQueue', 'LifoQueue', 'JoinableQueue', 'QueueFull', 'QueueEmpty'] from asyncio.events import AbstractEventLoop -from .tasks import coroutine +from .coroutines import coroutine from .futures import Future diff --git a/stdlib/3.4/asyncio/tasks.pyi b/stdlib/3.4/asyncio/tasks.pyi index 3adebe1ba..4475c4ab0 100644 --- a/stdlib/3.4/asyncio/tasks.pyi +++ b/stdlib/3.4/asyncio/tasks.pyi @@ -6,7 +6,7 @@ from asyncio.futures import Future # 'gather', 'shield', # ] -__all__ = ['coroutine', 'Task', 'sleep', +__all__ = ['Task', 'sleep', 'FIRST_COMPLETED', 'FIRST_EXCEPTION', 'ALL_COMPLETED', 'wait', 'wait_for'] @@ -14,7 +14,6 @@ FIRST_EXCEPTION = 'FIRST_EXCEPTION' FIRST_COMPLETED = 'FIRST_COMPLETED' ALL_COMPLETED = 'ALL_COMPLETED' _T = TypeVar('_T') -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]]]]: ...