Add type-annots to sampler subscription method internals

basic_buy_bot
Tyler Goodlet 2023-06-14 14:46:23 -04:00
parent 6a1c49be4e
commit 6b2e85e4b3
1 changed files with 3 additions and 5 deletions

View File

@ -145,8 +145,7 @@ class _FeedsBus(Struct):
key: str, key: str,
) -> set[ ) -> set[
tuple[ tuple[
Union[tractor.MsgStream, trio.MemorySendChannel], tractor.MsgStream | trio.MemorySendChannel,
# tractor.Context,
float | None, # tick throttle in Hz float | None, # tick throttle in Hz
] ]
]: ]:
@ -161,7 +160,6 @@ class _FeedsBus(Struct):
key: str, key: str,
subs: set[tuple[ subs: set[tuple[
tractor.MsgStream | trio.MemorySendChannel, tractor.MsgStream | trio.MemorySendChannel,
# tractor.Context,
float | None, # tick throttle in Hz float | None, # tick throttle in Hz
]], ]],
) -> set[tuple]: ) -> set[tuple]:
@ -169,7 +167,7 @@ class _FeedsBus(Struct):
Add a ``set`` of consumer subscription entries for the given key. Add a ``set`` of consumer subscription entries for the given key.
''' '''
_subs = self._subscribers[key] _subs: set[tuple] = self._subscribers[key]
_subs.update(subs) _subs.update(subs)
return _subs return _subs
@ -183,7 +181,7 @@ class _FeedsBus(Struct):
Remove a ``set`` of consumer subscription entries for key. Remove a ``set`` of consumer subscription entries for key.
''' '''
_subs = self.get_subs(key) _subs: set[tuple] = self.get_subs(key)
_subs.difference_update(subs) _subs.difference_update(subs)
return _subs return _subs