Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor cli.py to use f-string#6359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
cnaples79 wants to merge1 commit intooptuna:master
base:master
Choose a base branch
Loading
fromcnaples79:refactor-cli-fstring

Conversation

@cnaples79
Copy link

Summary

  • Replace.format() with f-string incli.py for version string formatting
  • Part of the f-string migration effort

Changes Made

  • File:optuna/cli.py
  • Line 925: Changed"{0} {1}".format("optuna", optuna.__version__) tof"optuna {optuna.__version__}"
  • Follows modern Python conventions now that Python 3.8 support is dropped

Rationale

This change simplifies string formatting and improves code readability by using Python's f-string syntax instead of the older.format() method. This is part of the codebase-wide refactoring initiative to modernize string formatting.

Fixes#6305

Replace .format() with f-string for version string formattingfollowing modern Python conventions.Fixesoptuna#6305
Copy link
Member

@c-batac-bata left a comment
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM. Sorry, I've just noticed that CI was failed.

@c-batac-bata added the code-fixChange that does not change the behavior, such as code refactoring. labelNov 28, 2025
@c-batac-bata added this to thev4.7.0 milestoneNov 28, 2025
Copy link
Member

@c-batac-bata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@cnaples79 Could you run ruff formatter?

@c-batac-bata self-assigned thisNov 28, 2025
@c-batac-bata removed this from thev4.7.0 milestoneDec 1, 2025
@github-actions
Copy link
Contributor

This pull request has not seen any recent activity.

@github-actionsgithub-actionsbot added the staleExempt from stale bot labeling. labelDec 8, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@c-batac-batac-bata requested changes

Requested changes must be addressed to merge this pull request.

Assignees

@c-batac-bata

Labels

code-fixChange that does not change the behavior, such as code refactoring.staleExempt from stale bot labeling.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Use f-string and{var_name=} instead of.format andvar_name={var_name}

2 participants

@cnaples79@c-bata

[8]ページ先頭

©2009-2025 Movatter.jp