From 3de624f9807604a836d2f6c19a482c1d57f30c16 Mon Sep 17 00:00:00 2001 From: Maico Timmerman Date: Mon, 6 Jan 2025 14:40:07 +0100 Subject: [PATCH] Improve return type for socket.getaddrinfo for missing ipv6 support (#13372) --- stdlib/socket.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/socket.pyi b/stdlib/socket.pyi index ab22cced0..f982c9b89 100644 --- a/stdlib/socket.pyi +++ b/stdlib/socket.pyi @@ -1399,7 +1399,7 @@ def create_server( address: _Address, *, family: int = ..., backlog: int | None = None, reuse_port: bool = False, dualstack_ipv6: bool = False ) -> socket: ... -# the 5th tuple item is an address +# The 5th tuple item is the socket address, for IP4, IP6, or IP6 if Python is compiled with --disable-ipv6, respectively. def getaddrinfo( host: bytes | str | None, port: bytes | str | int | None, family: int = 0, type: int = 0, proto: int = 0, flags: int = 0 -) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ... +) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int] | tuple[int, bytes]]]: ...