From 6b2e85e4b391f8bd3acbad72eab597db96d217af Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 14 Jun 2023 14:46:23 -0400 Subject: [PATCH] Add type-annots to sampler subscription method internals --- piker/data/feed.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/piker/data/feed.py b/piker/data/feed.py index 775e8fc6..2e2a63b5 100644 --- a/piker/data/feed.py +++ b/piker/data/feed.py @@ -145,8 +145,7 @@ class _FeedsBus(Struct): key: str, ) -> set[ tuple[ - Union[tractor.MsgStream, trio.MemorySendChannel], - # tractor.Context, + tractor.MsgStream | trio.MemorySendChannel, float | None, # tick throttle in Hz ] ]: @@ -161,7 +160,6 @@ class _FeedsBus(Struct): key: str, subs: set[tuple[ tractor.MsgStream | trio.MemorySendChannel, - # tractor.Context, float | None, # tick throttle in Hz ]], ) -> set[tuple]: @@ -169,7 +167,7 @@ class _FeedsBus(Struct): Add a ``set`` of consumer subscription entries for the given key. ''' - _subs = self._subscribers[key] + _subs: set[tuple] = self._subscribers[key] _subs.update(subs) return _subs @@ -183,7 +181,7 @@ class _FeedsBus(Struct): 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) return _subs