Repository navigation
Apply ruff/pyupgrade rules UP031 and UP032 - #261
Merged
Merged
Conversation
These are automatic fixes using: * `--select UP031 --fix --unsafe-fixes` * `--select UP032 --fix`
DimitriPapadopoulos
force-pushed
the
UP031-UP032
branch
from
October 25, 2026 15:16
5bcd7d7 to
e3174ee
Compare
These are manual fixes
DimitriPapadopoulos
force-pushed
the
UP031-UP032
branch
from
October 25, 2026 15:22
e3174ee to
5fe2d63
Compare
DimitriPapadopoulos
marked this pull request as ready for review
October 25, 2026 15:26
mattip
reviewed
Oct 27, 2026
| } | ||
| """ % (source, ' '.join(setters))) | ||
| }} | ||
| """.format(source, ' '.join(setters))) |
Contributor
There was a problem hiding this comment.
I read up to here, but am not sure about some of these. Is this really better than what we had?
Contributor
Author
There was a problem hiding this comment.
It depends from the point of view. These ruff rules update the code to use current Python constructs: f-strings - and format() where f-strings don't work well. I think the idea is that compliance with ruff rules results in more standard and efficient source code. Python has evolved from a simple script language with "one - and preferably only one - obvious way to do it" to a complex language. Standard formatting and linting brings back some simplicity, in the spirit of more recent languages such as Go or Rust that have learned from the "Perl-ification" of Python.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.