How (Not?) to Use Python’s List Comprehensions
There are very few reasons to nest comprehensions. When the need to go lazy arise and you end up with a long code, use a generator. &quot;yield&quot; is much more readable.