From 16baac694c11610f766b024ca5ecfd757133cee6 Mon Sep 17 00:00:00 2001 From: boringbyte Date: Mon, 2 Dec 2024 19:35:23 -0500 Subject: [PATCH] fix type annotations for 'optuna/_callbacks.py' --- optuna/_callbacks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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