diff --git a/optuna/_callbacks.py b/optuna/_callbacks.py index 7842fe5357..e53cedecb2 100644 --- a/optuna/_callbacks.py +++ b/optuna/_callbacks.py @@ -1,5 +1,6 @@ +from __future__ import annotations + from typing import Container -from typing import Optional import optuna from optuna.trial import FrozenTrial @@ -45,7 +46,7 @@ def objective(trial): """ def __init__( - self, n_trials: int, states: Optional[Container[TrialState]] = (TrialState.COMPLETE,) + self, n_trials: int, states: Container[TrialState] | None = (TrialState.COMPLETE,) ) -> None: self._n_trials = n_trials self._states = states