Skip to content

Commit

Permalink
Merge pull request optuna#5818 from boringbyte/fix/_callbacks.py
Browse files Browse the repository at this point in the history
Simplify type annotations for `optuna/_callbacks.py`
  • Loading branch information
not522 authored Dec 3, 2024
2 parents babf820 + 16baac6 commit 1934ea7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions optuna/_callbacks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

from typing import Container
from typing import Optional

import optuna
from optuna.trial import FrozenTrial
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1934ea7

Please sign in to comment.