Comment by Cyphase

2 years ago

Side note, you don't need `if bar_vec != []`. Trying to loop over an empty iterable (e.g. a list) just doesn't loop, since there's nothing there.

Also, another way to write this (which results in a flattened list) is:

  [foo(x) for bar_vec in bar_mat for y in bar_vec if baz(y) for x in y]