-
Notifications
You must be signed in to change notification settings - Fork 964
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
chore: upgrade python syntax #12702
chore: upgrade python syntax #12702
Conversation
Not super glamorous, but updated the codebase to take advantage of Python 3.11 syntax. Things like: - explicit `object` subclass - f-string syntax - `yield from` - `set()` => `{}` Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Signed-off-by: Mike Fiedler <miketheman@gmail.com>
Run `pyupgrade` first so that any other lint checks have to pass on the reformatted code. Found a couple of stragglers in the root directory as well. Signed-off-by: Mike Fiedler <miketheman@gmail.com>
"The user '{0}' isn't allowed to upload to project '{1}'. " | ||
"See {2} for more information." | ||
"The user '{}' isn't allowed to upload to project '{}'. " | ||
"See {} for more information." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this become an f-string? I'm surprised it didn't catch this use of .format
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect it has something to do with the complex usage of request.help_url(_anchor="project-name"),
and quotations - there's a test that shows this should be a noop:
https://github.com/asottile/pyupgrade/blob/ff43f9a6ab4c37d0a89a4bb5ae338c2d0233b5eb/tests/features/fstrings_test.py#L34-L37
"The given token isn't allowed to upload to project '{}'. " | ||
"See {} for more information." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto here.
Not super glamorous, but updated the codebase to take advantage of Python 3.11 syntax.
Things like:
object
subclassyield from
set()
=>{}
Signed-off-by: Mike Fiedler miketheman@gmail.com