mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
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:
committed by
David Soria Parra
parent
4d0a9e6d49
commit
0f5c38a2ce
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user