improve asyncio.AbstractEventLoop.getaddrinfo() (#1867)

The signature should match that of socket.getaddrinfo()
This commit is contained in:
NODA, Kai
2018-02-15 00:09:38 +08:00
committed by Łukasz Langa
parent fe4bea39a2
commit 3c4bc4266d

View File

@@ -96,7 +96,7 @@ class AbstractEventLoop(metaclass=ABCMeta):
@coroutine
# TODO the "Tuple[Any, ...]" should be "Union[Tuple[str, int], Tuple[str, int, int, int]]" but that triggers
# https://github.com/python/mypy/issues/2509
def getaddrinfo(self, host: str, port: int, *,
def getaddrinfo(self, host: Optional[str], port: Union[str, int, None], *,
family: int = ..., type: int = ..., proto: int = ..., flags: int = ...) -> Generator[Any, None, List[Tuple[int, int, int, str, Tuple[Any, ...]]]]: ...
@abstractmethod
@coroutine