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
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to