File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 66import functools
77from contextlib import suppress
88from types import TracebackType
9- from typing import Any , Callable
9+ from typing import Any , Callable , TypeAlias , TypeVar
1010
1111import betterproto
1212from websockets import ClientConnection , CloseCode , ConnectionClosed
2020 AgentResponseTrackData ,
2121)
2222
23- type TrackDataHandler = Callable [[AgentResponseTrackData ], None ]
23+ TrackDataHandler : TypeAlias = Callable [[AgentResponseTrackData ], None ]
24+
25+ TrackDataHandlerT = TypeVar ("TrackDataHandlerT" , bound = TrackDataHandler )
2426
2527
2628def _close_ok (e : ConnectionClosed ):
@@ -53,7 +55,7 @@ def _(_content: AgentResponseTrackData):
5355
5456 self ._dispatch_handler = _message_handler
5557
56- def on_track_data [ Handler : TrackDataHandler ] (self , handler : Handler ) -> Handler :
58+ def on_track_data (self , handler : TrackDataHandlerT ) -> TrackDataHandlerT :
5759 """
5860 Decorator used for defining a handler for track data messages from Fishjam.
5961 """
You can’t perform that action at this time.
0 commit comments