Skip to content

Use TYPE_CHECKING in nsgaii/_elite_population_selection_strategy.py#6523

Merged
c-bata merged 1 commit into
optuna:masterfrom
saivedant169:refactor/type-checking-nsgaii-elite
Mar 18, 2026
Merged

Use TYPE_CHECKING in nsgaii/_elite_population_selection_strategy.py#6523
c-bata merged 1 commit into
optuna:masterfrom
saivedant169:refactor/type-checking-nsgaii-elite

Conversation

@saivedant169
Copy link
Copy Markdown
Contributor

Part of #6029.

Moved Callable, Sequence, and FrozenTrial into TYPE_CHECKING. All three are only in type annotations. StudyDirection stays at module level since it's used as a value on line 128.

ruff check --select TCH passes clean.

…election_strategy.py

Moved Callable, Sequence, and FrozenTrial into TYPE_CHECKING.
StudyDirection stays at module level (used as a value on line 128).

Part of optuna#6029
Copy link
Copy Markdown
Member

@c-bata c-bata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@c-bata c-bata added the code-fix Change that does not change the behavior, such as code refactoring. label Mar 18, 2026
@c-bata c-bata added this to the v4.9.0 milestone Mar 18, 2026
@c-bata c-bata merged commit b188f71 into optuna:master Mar 18, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-fix Change that does not change the behavior, such as code refactoring.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants