3 ms·
So that flattening can also be written as: x = [[1,2], [3,4], [5,6]] [x for x in x for x in x] More perversely, we can also flatten with my invention:
by jamesdutc 13y ago
So that flattening can also be written as:
x = [[1,2], [3,4], [5,6]]
[x for x in x for x in x]
More perversely, we can also flatten with my invention:
list(None for x in x if (yield from x) and False) # Python >=3.3
More reasonably, of course,
list(itertools.chain.from_iterable(x))