Skip to content

Use TYPE_CHECKING in visualization/matplotlib/_rank.py - #6594

Merged
not522 merged 2 commits into
optuna:masterfrom
saivedant169:refactor/type-checking-mpl-rank
Mar 27, 2026
Merged

not522 merged 2 commits into
optuna:masterfrom
saivedant169:refactor/type-checking-mpl-rank

Conversation

@saivedant169

Copy link
Copy Markdown
Contributor

Moves Callable, Study, and FrozenTrial into the if TYPE_CHECKING block in visualization/matplotlib/_rank.py. All three are only referenced in type annotations, and from __future__ import annotations defers their evaluation.

Part of #6029.

Move `Callable`, `Study`, and `FrozenTrial` into the
`if TYPE_CHECKING` block. All three are only used in type
annotations, and `from __future__ import annotations` defers
evaluation.

See optuna#6029

Signed-off-by: saivedant169 <[email protected]>
@not522 not522 changed the title Use TYPE_CHECKING in visualization/matplotlib/_rank.py Use TYPE_CHECKING in visualization/matplotlib/_rank.py Mar 27, 2026

@not522 not522 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@not522 not522 added the code-fix Change that does not change the behavior, such as code refactoring. label Mar 27, 2026
@not522 not522 added this to the v4.9.0 milestone Mar 27, 2026
@not522
not522 merged commit e2bbb10 into optuna:master Mar 27, 2026
13 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