From 0f5c38a2ce9e99b8bfdbffc5f22cbaa371a69873 Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Fri, 29 Jan 2016 15:48:10 -0800 Subject: [PATCH] Add type information for asyncio.events.AbstractServer Add the appropriate types for AbstractServer in asyncio.events. wait_closed() is a couroutine, however in the implementation of AbstractServer not marked as such. We are adding the couroutine defintion here anyway, as we do want to make it typeable as a coroutine if necessary. --- stdlib/3.4/asyncio/__init__.pyi | 1 + stdlib/3.4/asyncio/events.pyi | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/stdlib/3.4/asyncio/__init__.pyi b/stdlib/3.4/asyncio/__init__.pyi index 1b55d7064..6c5dbe222 100644 --- a/stdlib/3.4/asyncio/__init__.pyi +++ b/stdlib/3.4/asyncio/__init__.pyi @@ -19,6 +19,7 @@ from asyncio.tasks import ( from asyncio.events import ( AbstractEventLoopPolicy as AbstractEventLoopPolicy, AbstractEventLoop as AbstractEventLoop, + AbstractServer as AbstractServer, Handle as Handle, get_event_loop as get_event_loop, ) diff --git a/stdlib/3.4/asyncio/events.pyi b/stdlib/3.4/asyncio/events.pyi index afdd6397e..c80506cce 100644 --- a/stdlib/3.4/asyncio/events.pyi +++ b/stdlib/3.4/asyncio/events.pyi @@ -1,6 +1,7 @@ from typing import Any, Awaitable, TypeVar, List, Callable, Tuple, Union, Dict, Generator from abc import ABCMeta, abstractmethod from asyncio.futures import Future +from asyncio.coroutines import coroutine # __all__ = ['AbstractServer', # 'TimerHandle', @@ -29,6 +30,10 @@ class Handle: def cancel(self) -> None: ... def _run(self) -> None: ... +class AbstractServer: + def close(self) -> None: ... + @coroutine + def wait_closed(self) -> None: ... class AbstractEventLoop(metaclass=ABCMeta): @abstractmethod