From 3a8d12189027e088a3d43184a5fe9bec38d65612 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Sun, 20 Mar 2022 15:17:55 +0200 Subject: [PATCH] Fix type of the "host" parameter in asyncio getaddrinfo() (#7517) --- stdlib/asyncio/base_events.pyi | 9 ++++++++- stdlib/asyncio/events.pyi | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/stdlib/asyncio/base_events.pyi b/stdlib/asyncio/base_events.pyi index 9eea2e166..c8eef793c 100644 --- a/stdlib/asyncio/base_events.pyi +++ b/stdlib/asyncio/base_events.pyi @@ -100,7 +100,14 @@ class BaseEventLoop(AbstractEventLoop): def set_default_executor(self, executor: Any) -> None: ... # Network I/O methods returning Futures. async def getaddrinfo( - self, host: str | None, port: str | int | None, *, family: int = ..., type: int = ..., proto: int = ..., flags: int = ... + self, + host: bytes | str | None, + port: str | int | None, + *, + family: int = ..., + type: int = ..., + proto: int = ..., + flags: int = ..., ) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ... async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = ...) -> tuple[str, str]: ... if sys.version_info >= (3, 8): diff --git a/stdlib/asyncio/events.pyi b/stdlib/asyncio/events.pyi index fbd09ec5c..6674702dd 100644 --- a/stdlib/asyncio/events.pyi +++ b/stdlib/asyncio/events.pyi @@ -211,7 +211,14 @@ class AbstractEventLoop: # Network I/O methods returning Futures. @abstractmethod async def getaddrinfo( - self, host: str | None, port: str | int | None, *, family: int = ..., type: int = ..., proto: int = ..., flags: int = ... + self, + host: bytes | str | None, + port: str | int | None, + *, + family: int = ..., + type: int = ..., + proto: int = ..., + flags: int = ..., ) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ... @abstractmethod async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = ...) -> tuple[str, str]: ...