Comments (4)
if a > 6 or a <= 4:
:)
from wemake-python-styleguide.
Yes, but that's not a chain condition, which is the whole point of this report.
from wemake-python-styleguide.
Forbid
not
with compare expressions.
This is exactly what this rule does. Or am I missing something? :)
from wemake-python-styleguide.
This rule forbids something like if not a < b
since it can be rewritten as if a >= b
. Here, the second version is clearly more readable which is (as I understand it) the reason for the rule - readability.
But for chain comparisons like if not a < b < c
there is no way to rewrite it without not
but still maintaining the chain comparison. Removing not
leads to something like if a >=b or b >= c
which (at least for me) is quite a lot less readable than what I had before. I would be fine with negated chain comparisons needing parentacise around them like if not (a < b < c)
.
from wemake-python-styleguide.
Related Issues (20)
- Disallow suppressing CancelledError
- def func(): ... causes false positives for WPS220, E704 and WPS473 HOT 6
- `self._tokens[1]`: `IndexError: list index out of range`
- Question about WPS324 — Enforce consistent return statements. HOT 2
- How to set up WPS (wemake-python-styleguide) autocheck in PyCharm HOT 1
- Drop `astor` in favour of `ast.unparse`
- Remove usage of deprecated nodes: `ast.Num`, `ast.Str`, `ast.Bytes`, etc
- Better detect literal nodes with `wps_op_eval`
- Do we still need `fix_line_number`?
- Too many exceptions in one `except`
- WPS221 wrong case
- WPS331 should recommend the opposite HOT 2
- Drop the abandoned `flake8-commas` plugin from deps HOT 2
- WPS602 features a dead link
- WPS474 False Positive
- Docstring errors reported on the line after the comment in certain cases
- Flakehean not maintained HOT 1
- Compare with ruff in README.md
- `WPS347` and `N811` rules conflict HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wemake-python-styleguide.