Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions stdlib/asyncio/protocols.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ class BufferedProtocol(BaseProtocol):
class DatagramProtocol(BaseProtocol):
__slots__ = ()
def connection_made(self, transport: transports.DatagramTransport) -> None: ... # type: ignore[override]
# addr can be a tuple[int, int] for some unusual protocols like socket.AF_NETLINK.
# Use tuple[str | Any, int] to not cause typechecking issues on most usual cases.
# This could be improved by using tuple[AnyOf[str, int], int] if the AnyOf feature is accepted.
# See https://github.com/python/typing/issues/566
def datagram_received(self, data: bytes, addr: tuple[str | Any, int]) -> None: ...
# addr is a tuple[str, int] for IPv4 or tuple[str, int, int, int] for IPv6.
# It can also be a tuple[int, int] for unusual protocols like socket.AF_NETLINK.
def datagram_received(self, data: bytes, addr: tuple[Any, ...]) -> None: ...
def error_received(self, exc: Exception) -> None: ...

class SubprocessProtocol(BaseProtocol):
Expand Down