pycodestyle
pycodestyle copied to clipboard
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.
Closes #680.