Apply refurb suggestions#372
Merged
jakirkham merged 1 commit intozarr-developers:mainfrom Oct 30, 2022
Merged
Conversation
1ce4873 to
e9362c2
Compare
b08df1c to
7b91ad9
Compare
7b91ad9 to
566ebe3
Compare
jakirkham
approved these changes
Oct 29, 2022
Member
jakirkham
left a comment
There was a problem hiding this comment.
Thanks Dimitri! 🙏
Merging after CI passes
* [FURB107] Replace `try: ... except ImportError: pass` with `with suppress(ImportError): ...` * [FURB109] Replace `in [x, y, z]` with `in (x, y, z)` * [FURB113] Use `x.extend(...)` instead of repeatedly calling `x.append()` * [FURB123] Replace `list(x)` with `x.copy()`
auto-merge was automatically disabled
October 29, 2022 22:29
Head branch was pushed to by a user without write access
d828871 to
4884dab
Compare
Contributor
Author
|
Rebased because of conflicts. |
Member
|
Thanks Dimitri! It's in 🙂 |
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.
try: ... except ImportError: passwithwith suppress(ImportError): ...in [x, y, z]within (x, y, z)x.extend(...)instead of repeatedly callingx.append()list(x)withx.copy()Not fixing all of them: some are debatable and other result in less readable (by me) code.
https://github.com/dosisod/refurb
TODO:
tox -e py310passes locallytox -e docspasses locally