Skip to content

Commit 600d508

Browse files
authored
chore(callbacks): type the fail-closed policy set precisely (#794)
1 parent 392cdc4 commit 600d508

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

code_puppy/callbacks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import asyncio
22
import logging
33
import traceback
4-
from typing import Any, Callable, Dict, List, Literal, Optional, Set
4+
from typing import Any, Callable, Dict, List, Literal, Optional, Set, Tuple
55

66
PhaseType = Literal[
77
"startup",
@@ -177,7 +177,7 @@ def __repr__(self) -> str:
177177
# (phase, callback) pairs registered with fail_closed=True. Keyed by pair, not
178178
# by callable: the same helper may be registered on several phases with
179179
# different policies, and one phase's choice must not leak into another.
180-
_fail_closed_callbacks: Set[tuple] = set()
180+
_fail_closed_callbacks: Set[Tuple[PhaseType, CallbackFunc]] = set()
181181

182182

183183
def _failure_result(

0 commit comments

Comments
 (0)