Skip to content

Commit cc590ab

Browse files
committed
remove generic alltogether from SignalService, typing memes
1 parent b554e94 commit cc590ab

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/async_utils/sig_service.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@
3333
type HandleableSignals = Literal["SIGINT", "SIGTERM", "SIGBREAK", "SIGHUP"]
3434
type SignalTuple = tuple[HandleableSignals, ...]
3535

36-
37-
type _DEF = tuple[Literal["SIGINT"], Literal["SIGTERM"], Literal["SIGBREAK"]]
38-
default_handled: Final[_DEF] = "SIGINT", "SIGTERM", "SIGBREAK"
36+
default_handled: Final = "SIGINT", "SIGTERM", "SIGBREAK"
3937

4038

4139
class SpecialExit(enum.IntEnum):
@@ -44,15 +42,15 @@ class SpecialExit(enum.IntEnum):
4442
EXIT = 252
4543

4644

47-
class SignalService[T: SignalTuple]:
45+
class SignalService:
4846
"""Helper for signal handling.
4947
5048
Meant for graceful signal handling where the main thread is only used
5149
for signal handling.
5250
This should be paired with event loops being run in threads.
5351
"""
5452

55-
def __init__(self, signals: T = default_handled, /) -> None:
53+
def __init__(self, signals: SignalTuple = default_handled, /) -> None:
5654
self._startup: list[StartStopCall] = []
5755
self._cbs: list[SignalCallback] = []
5856
self._joins: list[StartStopCall] = []

0 commit comments

Comments
 (0)