Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust typing stubs to match type hints in trio itself. #98

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
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
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
Loading