diff --git a/optuna/samplers/_random.py b/optuna/samplers/_random.py index 4f1283cc53..f93a4ee2ce 100644 --- a/optuna/samplers/_random.py +++ b/optuna/samplers/_random.py @@ -1,8 +1,6 @@ from __future__ import annotations from typing import Any -from typing import Dict -from typing import Optional from typing import TYPE_CHECKING from optuna import distributions @@ -43,7 +41,7 @@ def objective(trial): seed: Seed for random number generator. """ - def __init__(self, seed: Optional[int] = None) -> None: + def __init__(self, seed: int | None = None) -> None: self._rng = LazyRandomState(seed) def reseed_rng(self) -> None: @@ -51,12 +49,12 @@ def reseed_rng(self) -> None: def infer_relative_search_space( self, study: Study, trial: FrozenTrial - ) -> Dict[str, BaseDistribution]: + ) -> dict[str, BaseDistribution]: return {} def sample_relative( - self, study: Study, trial: FrozenTrial, search_space: Dict[str, BaseDistribution] - ) -> Dict[str, Any]: + self, study: Study, trial: FrozenTrial, search_space: dict[str, BaseDistribution] + ) -> dict[str, Any]: return {} def sample_independent(