Fix type of the "host" parameter in asyncio getaddrinfo() (#7517)

This commit is contained in:
Alex Grönholm
2022-03-20 15:17:55 +02:00
committed by GitHub
parent b7d129f727
commit 3a8d121890
2 changed files with 16 additions and 2 deletions

View File

@@ -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):

View File

@@ -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]: ...