Skip to content

Commit 3a8d121

Browse files
authored
Fix type of the "host" parameter in asyncio getaddrinfo() (#7517)
1 parent b7d129f commit 3a8d121

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

stdlib/asyncio/base_events.pyi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,14 @@ class BaseEventLoop(AbstractEventLoop):
100100
def set_default_executor(self, executor: Any) -> None: ...
101101
# Network I/O methods returning Futures.
102102
async def getaddrinfo(
103-
self, host: str | None, port: str | int | None, *, family: int = ..., type: int = ..., proto: int = ..., flags: int = ...
103+
self,
104+
host: bytes | str | None,
105+
port: str | int | None,
106+
*,
107+
family: int = ...,
108+
type: int = ...,
109+
proto: int = ...,
110+
flags: int = ...,
104111
) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ...
105112
async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = ...) -> tuple[str, str]: ...
106113
if sys.version_info >= (3, 8):

stdlib/asyncio/events.pyi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,14 @@ class AbstractEventLoop:
211211
# Network I/O methods returning Futures.
212212
@abstractmethod
213213
async def getaddrinfo(
214-
self, host: str | None, port: str | int | None, *, family: int = ..., type: int = ..., proto: int = ..., flags: int = ...
214+
self,
215+
host: bytes | str | None,
216+
port: str | int | None,
217+
*,
218+
family: int = ...,
219+
type: int = ...,
220+
proto: int = ...,
221+
flags: int = ...,
215222
) -> list[tuple[AddressFamily, SocketKind, int, str, tuple[str, int] | tuple[str, int, int, int]]]: ...
216223
@abstractmethod
217224
async def getnameinfo(self, sockaddr: tuple[str, int] | tuple[str, int, int, int], flags: int = ...) -> tuple[str, str]: ...

0 commit comments

Comments
 (0)