Skip to content

Commit 80518a1

Browse files
committed
use TypeAlias
1 parent a0e691f commit 80518a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

adaptive/learner/balancing_learner.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
from adaptive.utils import cache_latest, named_product, restore
1717

1818
try:
19-
from typing import Literal
19+
from typing import Literal, TypeAlias
2020
except ImportError:
21-
from typing_extensions import Literal
21+
from typing_extensions import Literal, TypeAlias
2222

2323
try:
2424
import pandas
@@ -33,9 +33,9 @@ def dispatch(child_functions: list[Callable], arg: Any) -> Any:
3333
return child_functions[index](x)
3434

3535

36-
STRATEGY_TYPE = Literal["loss_improvements", "loss", "npoints", "cycle"]
36+
STRATEGY_TYPE: TypeAlias = Literal["loss_improvements", "loss", "npoints", "cycle"]
3737

38-
CDIMS_TYPE = Union[
38+
CDIMS_TYPE: TypeAlias = Union[
3939
Sequence[Dict[str, Any]],
4040
Tuple[Sequence[str], Sequence[Tuple[Any, ...]]],
4141
]

0 commit comments

Comments
 (0)