Closed randallpittman closed 1 year ago
Related, the extra parentheses are not needed--any
and all
accept the bare comprehension just fine.
Hello, @randallpittman, thanks for reporting this issue!
You are correct in all of your three main points:
not all(0 <= v <= 255 for v in v)
with any((0 <= v <= 255 for v in v))
is just wrongany(v < 0 or 255 < v for v in v)
is not any clearerI was able to reproduce it and will work on a fix.
Hi again, @randallpittman!
A fix for this issue was just merged and will be available in the next release.
Thank you for reporting it!
@ruancomelli No problem--thank you for your attention to the issue!
Now live!
Checklist
Description
On the following code:
Sourcery recommends the following change:
citing the
invert-any-all
rule. It seems that theinvert-any-all
rule does not know how to handle chained comparisons.This would be an appropriate application of the
invert-any-all
rule (though not an improvement in this case, IMO):Debug Information
IDE Version: Visual Studio Code 1.71.2
Sourcery Version: v0.12.9
Operating system and Version: Linux Mint 20.3