From 994e434294ae51f0495dbb4fbd733a57c4ae5ed4 Mon Sep 17 00:00:00 2001 From: Tim Stumbaugh Date: Thu, 5 Aug 2021 10:38:11 -0600 Subject: [PATCH] Update stubs for trio 0.18.0 - Remove max_refill_bytes from SSL (python-trio/trio#959) - Add synchronous close and context managers to the memory channels (python-trio/trio#1797) --- trio-stubs/__init__.pyi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/trio-stubs/__init__.pyi b/trio-stubs/__init__.pyi index be955a5..8574875 100644 --- a/trio-stubs/__init__.pyi +++ b/trio-stubs/__init__.pyi @@ -264,6 +264,9 @@ class MemorySendChannel(trio.abc.SendChannel[T_contra]): def clone(self: T) -> T: ... async def aclose(self) -> None: ... def statistics(self) -> _Statistics: ... + def close(self) -> None: ... + def __enter__(self) -> MemorySendChannel: ... + def __exit__(self, *exc: object) -> None: ... class MemoryReceiveChannel(trio.abc.ReceiveChannel[T_co]): def receive_nowait(self) -> T_co: ... @@ -271,6 +274,9 @@ class MemoryReceiveChannel(trio.abc.ReceiveChannel[T_co]): def clone(self: T) -> T: ... async def aclose(self) -> None: ... def statistics(self) -> _Statistics: ... + def close(self) -> None: ... + def __enter__(self) -> MemoryReceiveChannel: ... + def __exit__(self, *exc: object) -> None: ... # written as a class so you can say open_memory_channel[int](5) class open_memory_channel(Tuple[MemorySendChannel[T], MemoryReceiveChannel[T]]): @@ -511,7 +517,6 @@ class SSLStream(trio.abc.Stream): server_hostname: Optional[str] = None, server_side: bool = False, https_compatible: bool = False, - max_refill_bytes: int = ..., ) -> None: ... def getpeercert(self, binary_form: bool = ...) -> ssl._PeerCertRetType: ... def selected_npn_protocol(self) -> Optional[str]: ... @@ -536,7 +541,6 @@ class SSLListener(trio.abc.Listener[SSLStream]): ssl_context: ssl.SSLContext, *, https_compatible: bool = False, - max_refill_bytes: int = ..., ) -> None: ... async def accept(self) -> SSLStream: ... async def aclose(self) -> None: ...