Commit f7b377a
committed
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.1 parent 68cc24f commit f7b377a
2 files changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
608 | 608 | | |
609 | 609 | | |
610 | 610 | | |
611 | | - | |
| 611 | + | |
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
| |||
695 | 695 | | |
696 | 696 | | |
697 | 697 | | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
698 | 702 | | |
699 | 703 | | |
700 | 704 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
0 commit comments