Skip to content

Commit 1934ea7

Browse files
authored
Merge pull request optuna#5818 from boringbyte/fix/_callbacks.py
Simplify type annotations for `optuna/_callbacks.py`
2 parents babf820 + 16baac6 commit 1934ea7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

optuna/_callbacks.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
from __future__ import annotations
2+
13
from typing import Container
2-
from typing import Optional
34

45
import optuna
56
from optuna.trial import FrozenTrial
@@ -45,7 +46,7 @@ def objective(trial):
4546
"""
4647

4748
def __init__(
48-
self, n_trials: int, states: Optional[Container[TrialState]] = (TrialState.COMPLETE,)
49+
self, n_trials: int, states: Container[TrialState] | None = (TrialState.COMPLETE,)
4950
) -> None:
5051
self._n_trials = n_trials
5152
self._states = states

0 commit comments

Comments
 (0)