Slight typing and multi-line styling tweaks in `.ipc` sugpkg
parent
e904af679b
commit
08ac89b807
|
@ -478,7 +478,6 @@ async def attach_to_ringbuf_stream(
|
|||
yield trio.StapledStream(sender, receiver)
|
||||
|
||||
|
||||
|
||||
class RingBuffBytesSender(trio.abc.SendChannel[bytes]):
|
||||
'''
|
||||
In order to guarantee full messages are received, all bytes
|
||||
|
@ -522,7 +521,6 @@ class RingBuffBytesSender(trio.abc.SendChannel[bytes]):
|
|||
if self._batch_msg_len == self.batch_size:
|
||||
await self.flush()
|
||||
|
||||
|
||||
async def aclose(self) -> None:
|
||||
await self._sender.aclose()
|
||||
|
||||
|
|
|
@ -50,7 +50,10 @@ if _USE_POSIX:
|
|||
try:
|
||||
import numpy as np
|
||||
from numpy.lib import recfunctions as rfn
|
||||
import nptyping
|
||||
# TODO ruff complains with,
|
||||
# warning| F401: `nptyping` imported but unused; consider using
|
||||
# `importlib.util.find_spec` to test for availability
|
||||
import nptyping # noqa
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
|
|
@ -157,7 +157,10 @@ class MsgpackTransport(MsgTransport):
|
|||
|
||||
) -> None:
|
||||
self.stream = stream
|
||||
self._laddr, self._raddr = self.get_stream_addrs(stream)
|
||||
(
|
||||
self._laddr,
|
||||
self._raddr,
|
||||
) = self.get_stream_addrs(stream)
|
||||
|
||||
# create read loop instance
|
||||
self._aiter_pkts = self._iter_packets()
|
||||
|
|
|
@ -76,7 +76,7 @@ def transport_from_stream(
|
|||
'''
|
||||
transport = None
|
||||
if isinstance(stream, trio.SocketStream):
|
||||
sock = stream.socket
|
||||
sock: socket.socket = stream.socket
|
||||
match sock.family:
|
||||
case socket.AF_INET | socket.AF_INET6:
|
||||
transport = 'tcp'
|
||||
|
|
Loading…
Reference in New Issue