Skip to content

Replace .format() with f-strings in several modules#6348

Merged
c-bata merged 1 commit intooptuna:masterfrom
varundevr:replace-format-with-fstring
Nov 20, 2025
Merged

Replace .format() with f-strings in several modules#6348
c-bata merged 1 commit intooptuna:masterfrom
varundevr:replace-format-with-fstring

Conversation

@varundevr
Copy link
Copy Markdown
Contributor

Motivation

Modern Python recommends using f-strings over the older .format() syntax because they are more readable, concise, and perform better. Optuna already uses f-strings in many places, so this PR helps maintain consistency across the codebase.

This change is part of issue #6305.

Description of the changes

  • Replaced occurrences of .format() with f-strings in several modules.
  • No functional behavior was changed.
  • Only minor style improvements for readability and consistency.

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 Nov 20, 2025
@c-bata c-bata added this to the v4.7.0 milestone Nov 20, 2025
@c-bata c-bata merged commit 47526f5 into optuna:master Nov 20, 2025
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