Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: prefer %r/!r marker instead of calling repr in string formatting #11594

Open
Avasam opened this issue May 29, 2024 · 0 comments
Open

Comments

@Avasam
Copy link

Avasam commented May 29, 2024

See this PR for the kind of changes I'd like to see automated: mhammond/pywin32#2272

From:

"%s %s" % (repr(foo), bar)
"{} {}".format(repr(foo), bar)
f"{repr(foo)} {bar}"

To:

"%r %s" % (foo, bar)
"{!r} {}".format(foo, bar)
f"{foo!r} {bar}"

I don't think this is supported by any linter atm. This should synergize well with UP030-UP032

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant