How are you supposed to break up a very long list comprehension?
[something_that_is_pretty_long for something_that_is_pretty_long in somethings_that_are_pretty_long]
I have also seen somewhere that people that dislike using ‘\’ to break up lines,
but never understood why. What is the reason behind this?
works fine, so you can pretty much do as you please. I’d personally prefer
The reason why
\isn’t appreciated very much is that it appears at the end of a line, where it either doesn’t stand out or needs extra padding, which has to be fixed when line lengths change:In such cases, use parens: