-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
style: Modernize object inheritance, super() calls, and OSError aliases #3251
Conversation
…r for all aliases past Python 3.3
I might want some feedback on if the changes should be kept in the cgentypes folder, some of it seems like it is copied from another project. I wasn't sure if you were patching these up or it just wasn't in sync (like the lex.py file) |
I'd recommend leave out any non-critical changes from |
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.
To revert
python/libgrass_interface_generator/ctypesgen/printer_python/preamble.py
Outdated
Show resolved
Hide resolved
python/libgrass_interface_generator/ctypesgen/printer_python/printer.py
Outdated
Show resolved
Hide resolved
python/libgrass_interface_generator/ctypesgen/printer_python/printer.py
Outdated
Show resolved
Hide resolved
Since indeed, by definition it wasn't that essential, I reverted the changes from that folder
Maybe something that later could be handled in the periodic update workflow from #3200, wink wink! |
Since all checks have passed, is still up to date, and had 2 reviews, I think it could be ready to merge ;) |
In prevision of being able to introduce some faster (and more complete) Python checks, like with using the incredibly fast
ruff
linter https://docs.astral.sh/ruff/, part of the rules implemented come frompyupgrade
https://github.com/asottile/pyupgrade.pyupgrade
helps to automatically upgrade syntax to newer versions of Python. In order to reduce the diff if we decide to start using this, I'm starting by applying only three really simple changes, that apply to any version of python past python 3.3 (released in 2012, EOL in 2017).grass/gui/wxpython/gcp/manager.py
Lines 2368 to 2372 in 97da922
So in essence these are quite unlikely to cause serious regressions, as it is how it is supposed to work for a long time already.
The
pyupgrade
tool also has some filters to choose what minimum python version you want to support. After trying with--py37-plus
, I started again with--py3-only
and disabled the most I could. I then passed through the 300+ files to only keep these 3 changes