-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
stubs: false negativeType checkers do not report an error, but shouldType checkers do not report an error, but should
Description
#13344 / #13372 updated the return value of socket.getaddrinfo
to include tuple[int, bytes]
:
Lines 1402 to 1405 in 80dba41
# 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] | tuple[int, bytes]]]: ... |
I think it should be updated elsewhere too, such as the internal counterpart:
Lines 807 to 815 in 80dba41
# the 5th tuple item is an address | |
def getaddrinfo( | |
host: bytes | str | None, | |
port: bytes | str | int | None, | |
family: int = ..., | |
type: int = ..., | |
proto: int = ..., | |
flags: int = ..., | |
) -> list[tuple[int, int, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ... |
and possibly the type for the sockaddr
argument in getnameinfo
, though I haven't tested if a tuple[int, bytes]
is actually valid there (stdlib docs are unclear):
Line 820 in 80dba41
def getnameinfo(sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int, /) -> tuple[str, str]: ... |
Metadata
Metadata
Assignees
Labels
stubs: false negativeType checkers do not report an error, but shouldType checkers do not report an error, but should