[issue2292] Missing *-unpacking generalizations

Zbyszek Szmek report at bugs.python.org
Thu Jan 12 19:03:35 CET 2012


Zbyszek Szmek <zbyszek at in.waw.pl> added the comment:

#11682 will likely be merged. The part of this patch about "yielding everything from an iterator" becomes obsolete:
>>> def flatten(iterables):
...    for it in iterables:
...      yield from it
... 
>>> L = [ [0,1,2], (3, 4), {5}, {6: None}, (i for i in range(7, 10)) ]
>>> list(flatten(L))
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

The rest is of course still valid and useful.

----------
nosy: +zbysz

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2292>
_______________________________________


More information about the Python-bugs-list mailing list