Skip to content

Move type-check imports to TYPE_CHECKING in optuna/terminator/callback.py#6388

Merged
not522 merged 2 commits intooptuna:masterfrom
Sip4818:type-hint-check-6
Dec 18, 2025
Merged

Move type-check imports to TYPE_CHECKING in optuna/terminator/callback.py#6388
not522 merged 2 commits intooptuna:masterfrom
Sip4818:type-hint-check-6

Conversation

@Sip4818
Copy link
Copy Markdown
Contributor

@Sip4818 Sip4818 commented Dec 16, 2025

Summary

This PR moves type-only imports (FrozenTrial, BaseTerminator, and Study ) into a TYPE_CHECKING block following Optuna’s type-hinting style, in the file optuna\terminator\callback.py

What was changed?

  • Moved type-only imports into a TYPE_CHECKING: block
  • Updated annotations accordingly
  • No functional behavior changed

related to #6029

Copy link
Copy Markdown
Member

@not522 not522 left a comment

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 Dec 18, 2025
@not522 not522 added this to the v4.7.0 milestone Dec 18, 2025
@not522 not522 merged commit 9168ff5 into optuna:master Dec 18, 2025
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