-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
really drop python<=3.7 #3391
really drop python<=3.7 #3391
Conversation
Filter all code over `pyupgrade --py38-plus`. Signed-off-by: Tomasz Kłoczko <[email protected]>
Mostly removes unused imports. Signed-off-by: Tomasz Kłoczko <[email protected]>
Most of these actually date back to Python 3.0 or earlier (e.g. the default I'm not sure about that second |
|
I'm not in the market for a new linter (well, I may switch from flake8 to plain pyflakes now that black and pep8 are diverging). I care more about a high signal-to-noise ratio than just detecting more stuff (this is why I use pyflakes and not pylint).
It also needs to pass the linters ( |
Signed-off-by: Tomasz Kłoczko <[email protected]>
OK I've added commit with all changes generated by |
@@ -47,7 +47,7 @@ | |||
"foo".encode("idna") | |||
|
|||
# For undiagnosed reasons, 'latin1' codec may also need to be preloaded. | |||
"foo".encode("latin1") | |||
b"foo" |
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.
This useless-looking call to encode()
is significant - it ensures that the codec is initialized here (where we are presumably executing on the main thread) instead of later in another thread, which has the potential to deadlock.
I've got almost all the pyupgrade changes in a new PR, #3403. I had to hack on pyupgrade a bit to disable one change and then break things out into separate commits for easier review. I also found that running pyupgrade in two passes will convert percent formatting to str.format and then str.format to fstrings, which is nice. |
Thank you 👍 |
Filter all code over
pyupgrade --py38-plus
.