16 Oct
2016
16 Oct
'16
3:40 p.m.
On Sun, Oct 16, 2016 at 03:02:55PM +0200, Ivan Levkivskyi wrote:
What I have learned from this megathread is that the syntax [*foo for foo in bar] is proposed as a replacement for a one-liner itertools.chain(*[foo for foo in bar]).
If people take away nothing else from this thread, it should be that flattening an iterable is as easy as: [x for t in iterable for x in t] which corresponds neatly to: for t in iterable: for x in t: result.append(x) -- Steve