socket: allow ReadableBuffer on send* methods (#5648)

This commit is contained in:
Jelle Zijlstra
2021-06-16 06:36:56 -07:00
committed by GitHub
parent 04d81a8499
commit e58070cd35
2 changed files with 17 additions and 11 deletions

View File

@@ -554,19 +554,23 @@ class socket:
) -> tuple[int, list[_CMSG], int, Any]: ...
def recvfrom_into(self, buffer: WriteableBuffer, nbytes: int = ..., flags: int = ...) -> tuple[int, _RetAddress]: ...
def recv_into(self, buffer: WriteableBuffer, nbytes: int = ..., flags: int = ...) -> int: ...
def send(self, __data: bytes, __flags: int = ...) -> int: ...
def sendall(self, __data: bytes, __flags: int = ...) -> None: ...
def send(self, __data: ReadableBuffer, __flags: int = ...) -> int: ...
def sendall(self, __data: ReadableBuffer, __flags: int = ...) -> None: ...
@overload
def sendto(self, __data: bytes, __address: _Address) -> int: ...
def sendto(self, __data: ReadableBuffer, __address: _Address) -> int: ...
@overload
def sendto(self, __data: bytes, __flags: int, __address: _Address) -> int: ...
def sendto(self, __data: ReadableBuffer, __flags: int, __address: _Address) -> int: ...
if sys.platform != "win32":
def sendmsg(
self, __buffers: Iterable[bytes], __ancdata: Iterable[_CMSGArg] = ..., __flags: int = ..., __address: _Address = ...
self,
__buffers: Iterable[ReadableBuffer],
__ancdata: Iterable[_CMSGArg] = ...,
__flags: int = ...,
__address: _Address = ...,
) -> int: ...
if sys.platform == "linux":
def sendmsg_afalg(
self, msg: Iterable[bytes] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ...
self, msg: Iterable[ReadableBuffer] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ...
) -> int: ...
def setblocking(self, __flag: bool) -> None: ...
def settimeout(self, __value: float | None) -> None: ...