-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
MAINT: Start applying ruff/flake8-comprehensions rules (C4) #27296
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
Conversation
This also has linting errors! (So I didn't review yet) |
The linting errors are |
Probably best to just fix them - best not to merge PRs which do not pass the tests... |
f3211c7
to
def772c
Compare
Should be fixed by running $ ruff check --preview --select E231 numpy/_core/tests/test_nditer.py --fix
Found 33 errors (33 fixed, 0 remaining).
$ |
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.
Hmm, weird that that was the problem, especially as there seem to be worse problems (at least visually).
64a8569
to
a887b51
Compare
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.
Couple of ugly spots, otherwise looks OK. A few tricky bits, but mostly straightforward.
C410 Unnecessary `list` literal passed to `list()` (remove the outer call to `list()`)
C414 Unnecessary `list` call within `sorted()`
C416 Unnecessary `list` comprehension (rewrite using `list()`)
E231 Missing whitespace after ',' Apply to a single file to please the current linter.
C417 Unnecessary `map` usage (rewrite using a generator expression)
C419 Unnecessary list comprehension
a887b51
to
486ad9b
Compare
Thanks @DimitriPapadopoulos . |
In preparation for #24994.