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.
This commit is contained in:
David Soria Parra
2016-01-29 15:48:10 -08:00
committed by David Soria Parra
parent 4d0a9e6d49
commit 0f5c38a2ce
2 changed files with 6 additions and 0 deletions

View File

@@ -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,
)

View File

@@ -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