Repository navigation
Conversation
b872f3a to
43990cb
Compare
43990cb to
0d7150b
Compare
ilyamandel
left a comment
There was a problem hiding this comment.
I realise these are all minor changes, but given the extensive range of changes, I'd be grateful if someone with more python expertise than me could take a look; will ask on our Slack channel, but pinging @pauldisberg , @avigna , @SimonStevenson , @FloorBroekgaarden , @jeffriley ...
|
This PR looks to me like a mixture of objective improvements (no reason not to drop excess brackets) and style choices (which I'll leave up to the core devs). The style choices looks like mostly changes to type hinting and changes to variable formatting (specifically toward f-strings). I'm not sure the value in making all the style changes but in any case it's more difficult to discuss the changes when they're all mixed together like this. Could you split them up into separate PRs for different broad groupings? E.g. type hints, string formatting, excess brackets, then maybe "other stuff"? |
|
I think this also forces users to use py>=3.9 (x: dict = {} from 3.9 i think?) @ilyamandel -- do you know if any users are using py <3.9? This PR would break the tools for those users i think... |
All changes are coming from single ruleset: https://docs.astral.sh/ruff/rules/?linter=pyupgrade-up The overall goal is to modernize the code, make use of newer Python features and remove the old ones. This helps to have a common language (convention) with other Python developers and making the project future proof. I don't categorize these changes as stylistic vs functional. In the ruff's context, a style related linting would be the to
Not sure we would like to discuss every item from https://docs.astral.sh/ruff/rules/?linter=pyupgrade-up individiually, but I'm okay with making smaller PRs. Will create one for type hints and then let's see how it goes. |
I can set the target version to 3.8, not sure why I chose 3.9, but 3.8 EOL'd two years ago and it's not getting any security updates - I wouldn't recommend anyone to keep using it: https://devguide.python.org/versions/ I'd also recommend following https://scientific-python.org/specs/spec-0000/ and keeping the support window shorter than 7 years. |
0d7150b to
c23a610
Compare
Modernizes the code and cleans the practices from older Python versions
https://docs.astral.sh/ruff/rules/#pyupgrade-up