From 6c1c18b697f0fd9b8680d407ad429e197d22ebd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Sun, 20 Mar 2022 13:29:24 +0200 Subject: [PATCH] Fixed type of the "host" parameter in asyncio getaddrinfo() --- 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 9eea2e16641e..c8eef793c754 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 fbd09ec5c8d5..6674702dd2d4 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]: ...