Skip to content

refactor: move BaseDistribution into TYPE_CHECKING in search_space/intersection.py#6467

Merged
c-bata merged 1 commit intooptuna:masterfrom
dhruvildarji:refactor/type-checking-search-space-intersection
Feb 24, 2026
Merged

refactor: move BaseDistribution into TYPE_CHECKING in search_space/intersection.py#6467
c-bata merged 1 commit intooptuna:masterfrom
dhruvildarji:refactor/type-checking-search-space-intersection

Conversation

@dhruvildarji
Copy link
Copy Markdown
Contributor

@dhruvildarji dhruvildarji commented Feb 23, 2026

Refs #6029

Move from optuna.distributions import BaseDistribution into the existing TYPE_CHECKING block in optuna/search_space/intersection.py, since it is only used in type annotations and the file already has from __future__ import annotations.

Verified with ruff check optuna/search_space/intersection.py --select TCH — all checks pass.

…tersection.py

Move `from optuna.distributions import BaseDistribution` into the
existing TYPE_CHECKING block since it is only used for type annotations.

Fixes 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 Feb 24, 2026
@c-bata c-bata added this to the v4.8.0 milestone Feb 24, 2026
@c-bata c-bata merged commit 1a700ab into optuna:master Feb 24, 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