Skip to content

Replace format with f-string #6383

Merged
not522 merged 6 commits intooptuna:masterfrom
varundevr:replace-format-with-fstring-4
Dec 12, 2025
Merged

Replace format with f-string #6383
not522 merged 6 commits intooptuna:masterfrom
varundevr:replace-format-with-fstring-4

Conversation

@varundevr
Copy link
Copy Markdown
Contributor

Motivation

This pull request is part of the ongoing effort described in #6305 to modernize string formatting across the Optuna codebase. Replacing str.format() with f-strings improves readability, reduces verbosity, and aligns the code with current Python best practices.

Description of the changes

Replaced a remaining instance of .format() with an equivalent f-string.

Preserved the exact behavior and message format — no functional changes.

Updated only the relevant line to keep the PR small and focused as requested in #6305.

@not522 not522 added the code-fix Change that does not change the behavior, such as code refactoring. label Dec 12, 2025
@not522 not522 added this to the v4.7.0 milestone Dec 12, 2025
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.

Thank you! LGTM!

@not522 not522 changed the title Replace format with fstring Replace format with f-string Dec 12, 2025
@not522 not522 merged commit 591574e into optuna:master Dec 12, 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