Skip to content

Use __future__.annotations in matplotlib/_intermediate_values#6425

Merged
not522 merged 1 commit intooptuna:masterfrom
Lakshman142:fix/future-annotations-intermediate-values
Jan 27, 2026
Merged

Use __future__.annotations in matplotlib/_intermediate_values#6425
not522 merged 1 commit intooptuna:masterfrom
Lakshman142:fix/future-annotations-intermediate-values

Conversation

@Lakshman142
Copy link
Copy Markdown
Contributor

Motivation

Issue #4508 tracks the ongoing effort to use postponed evaluation of type annotations across the Optuna codebase.

The matplotlib intermediate values visualization currently uses quoted type annotations for Axes due to conditional imports. Using from future import annotations allows these annotations to be evaluated lazily, improving readability and consistency with other visualization modules.

Description of the changes

  • Added from future import annotations to the matplotlib intermediate values visualization module.
  • Removed quoted return type annotations for Axes and replaced them with standard annotations.
  • No functional or behavioral changes were introduced.

Fixes #4508

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 Jan 27, 2026
@not522 not522 added this to the v4.8.0 milestone Jan 27, 2026
@not522 not522 merged commit c2b3361 into optuna:master Jan 27, 2026
15 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.

Use __future__.annotations everywhere in the Optuna code base

2 participants