Skip to content

Commit

Permalink
Stringify 'TreeDef' to avoid if TYPE_CHECKING
Browse files Browse the repository at this point in the history
  • Loading branch information
clint-lawrence committed Jun 4, 2024
1 parent 8b94e31 commit cebeadf
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/fixate/core/switching.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import itertools
import time
from typing import (
TYPE_CHECKING,
Generic,
Optional,
Callable,
Expand All @@ -42,7 +41,6 @@
Union,
Collection,
Dict,
Any,
FrozenSet,
Set,
)
Expand All @@ -55,12 +53,7 @@
PinList = Sequence[Pin]
PinSet = FrozenSet[Pin]
SignalMap = Dict[Signal, PinSet]

if TYPE_CHECKING:
# The self reference doesn't work at runtime, by mypy knows what it means.
TreeDef = Sequence[Union[Signal, TreeDef]]
else:
TreeDef = Sequence[Any]
TreeDef = Sequence[Union[Signal, "TreeDef"]]


@dataclass(frozen=True)
Expand Down

0 comments on commit cebeadf

Please sign in to comment.