Skip to content

Commit

Permalink
Merge pull request #98 from apollo13/patch-1
Browse files Browse the repository at this point in the history
Adjust typing stubs to match type hints in trio itself.
  • Loading branch information
tjstum authored Oct 24, 2024
2 parents c7d9707 + a71e983 commit e018f1f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions trio-stubs/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class StapledStream(trio.abc.HalfCloseableStream):
send_stream: trio.abc.SendStream = attr.ib()
receive_stream: trio.abc.ReceiveStream = attr.ib()
async def aclose(self) -> None: ...
async def send_all(self, data: Union[bytes, memoryview]) -> None: ...
async def send_all(self, data: Union[bytes, bytearray, memoryview]) -> None: ...
async def wait_send_all_might_not_block(self) -> None: ...
async def receive_some(self, max_bytes: Optional[int] = ...) -> bytes: ...
async def send_eof(self) -> None: ...
Expand Down Expand Up @@ -413,7 +413,7 @@ class SocketStream(trio.abc.HalfCloseableStream):
@overload
def getsockopt(self, level: int, option: int, buffersize: int) -> bytes: ...
async def aclose(self) -> None: ...
async def send_all(self, data: Union[bytes, memoryview]) -> None: ...
async def send_all(self, data: Union[bytes, bytearray, memoryview]) -> None: ...
async def wait_send_all_might_not_block(self) -> None: ...
async def receive_some(self, max_bytes: Optional[int] = ...) -> bytes: ...
async def send_eof(self) -> None: ...
Expand Down Expand Up @@ -829,7 +829,7 @@ class SSLStream(trio.abc.Stream):
async def do_handshake(self) -> None: ...
async def unwrap(self) -> Tuple[trio.abc.Stream, bytes]: ...
async def aclose(self) -> None: ...
async def send_all(self, data: Union[bytes, memoryview]) -> None: ...
async def send_all(self, data: Union[bytes, bytearray, memoryview]) -> None: ...
async def wait_send_all_might_not_block(self) -> None: ...
async def receive_some(self, max_bytes: Optional[int] = ...) -> bytes: ...

Expand Down
2 changes: 1 addition & 1 deletion trio-stubs/abc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class AsyncResource(metaclass=ABCMeta):

class SendStream(AsyncResource):
@abstractmethod
async def send_all(self, data: Union[bytes, memoryview]) -> None: ...
async def send_all(self, data: Union[bytes, bytearray, memoryview]) -> None: ...
@abstractmethod
async def wait_send_all_might_not_block(self) -> None: ...

Expand Down
2 changes: 1 addition & 1 deletion trio-stubs/lowlevel.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ else:
@final
class FdStream(trio.abc.Stream):
def __init__(self, fd: int): ...
async def send_all(self, data: Union[bytes, memoryview]) -> None: ...
async def send_all(self, data: Union[bytes, bytearray, memoryview]) -> None: ...
async def wait_send_all_might_not_block(self) -> None: ...
async def receive_some(self, max_bytes: Optional[int] = ...) -> bytes: ...
async def aclose(self) -> None: ...
Expand Down
2 changes: 1 addition & 1 deletion trio-stubs/socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class SocketType:
async def sendmsg(
self,
buffers: Iterable[ReadableBuffer],
ancdata: Iterable[Tuple[int, int, Union[bytes, memoryview]]] = ...,
ancdata: Iterable[Tuple[int, int, Union[bytes, bytearray, memoryview]]] = ...,
flags: int = ...,
address: Union[Tuple[Any, ...], str] = ...,
) -> int: ...
Expand Down

0 comments on commit e018f1f

Please sign in to comment.