-
Notifications
You must be signed in to change notification settings - Fork 748
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve check for logical continuation in comprehension.
Excludes ``` sorted(obj for obj in iterator if some_long_cond() and some_other_cond()) ``` from E127. It is true that this also lets through some "bad" indents e.g. ``` (1 if a and 2 else b) ``` but at the tokenization level it is quite difficult to distinguish between the "if" in `a for b in c if d` and the "if" in `a if b else c`, which play quite different roles.
- Loading branch information
Showing
2 changed files
with
9 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -639,3 +639,7 @@ def other_example(): | |
# more stuff | ||
) | ||
) | ||
#: W503 | ||
sorted(obj for obj in [] | ||
if True | ||
and False) |