-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Apply more assorted Pyugrade suggestions #4125
Commits on Jan 5, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 0f08db8 - Browse repository at this point
Copy the full SHA 0f08db8View commit details -
"yield from", instead of "yield" in a loop
This is a suggestion from pyupgrade: https://github.com/asottile/pyupgrade#yield--yield-from
Configuration menu - View commit details
-
Copy full SHA for ac3bf62 - Browse repository at this point
Copy the full SHA ac3bf62View commit details -
In Python 3, io.open() is an alias for the builtin open() function. https://docs.python.org/3/library/io.html#io.open This is a suggestion from pyupgrade: https://github.com/asottile/pyupgrade#open-alias
Configuration menu - View commit details
-
Copy full SHA for af41360 - Browse repository at this point
Copy the full SHA af41360View commit details -
See PEP 3135: https://peps.python.org/pep-3135/ This is a suggestion from pyupgrade: https://github.com/asottile/pyupgrade#super-calls
Configuration menu - View commit details
-
Copy full SHA for bba79a0 - Browse repository at this point
Copy the full SHA bba79a0View commit details -
Don't cast string literals with str()
Fixed by running `ruff --select UP018 --fix .`: UP018 [*] Unnecessary `str` call (rewrite as a literal) Original suggestions from pyupgrade: https://github.com/asottile/pyupgrade#forced-strnative-literals
Configuration menu - View commit details
-
Copy full SHA for 1ddffe4 - Browse repository at this point
Copy the full SHA 1ddffe4View commit details -
This is an alias for the built-in OSError exception: https://docs.python.org/3/library/os.html#os.error Fixed by running `ruff --select UP024 --fix .`: UP024 [*] Replace aliased errors with `OSError`
Configuration menu - View commit details
-
Copy full SHA for 8da1688 - Browse repository at this point
Copy the full SHA 8da1688View commit details -
In Python ≥ 3.7, `capture_output` can be used instead of `stdout=PIPE` / `stderr=PIPE`. Fixed by running `ruff --select UP022 --fix --unsafe-fixes .`: UP022 Sending `stdout` and `stderr` to `PIPE` is deprecated, use `capture_output`
Configuration menu - View commit details
-
Copy full SHA for a628dc5 - Browse repository at this point
Copy the full SHA a628dc5View commit details -
Remove extraneous pair of prentheses
Fixed by running `ruff --select UP034 --fix .`: UP034 [*] Avoid extraneous parentheses
Configuration menu - View commit details
-
Copy full SHA for b5f07c9 - Browse repository at this point
Copy the full SHA b5f07c9View commit details -
Get rid of one last
coding: utf-8
In Python 3, the source encodign is implict, UTF-8 by default. This is a suggestion from pyupgrade: https://github.com/asottile/pyupgrade#-coding--comment Fixed by running `ruff --select UP009 --fix .`: UP009 [*] UTF-8 encoding declaration is unnecessary
Configuration menu - View commit details
-
Copy full SHA for 86bb681 - Browse repository at this point
Copy the full SHA 86bb681View commit details -
Use byte literals instead of .encode()
This is a suggestion from pyupgrade: https://github.com/asottile/pyupgrade#encode-to-bytes-literals Fixed by running `ruff --select UP012 --fix .`: UP012 [*] Unnecessary call to `encode` as UTF-8
Configuration menu - View commit details
-
Copy full SHA for 5ba5c2e - Browse repository at this point
Copy the full SHA 5ba5c2eView commit details -
Fixed by running `ruff --select UP027 --fix .`: UP027 [*] Replace unpacked list comprehension with a generator expression
Configuration menu - View commit details
-
Copy full SHA for a142991 - Browse repository at this point
Copy the full SHA a142991View commit details -
Configuration menu - View commit details
-
Copy full SHA for 07774d9 - Browse repository at this point
Copy the full SHA 07774d9View commit details