17 Oct
2016
17 Oct
'16
6:53 p.m.
On Mon, Oct 17, 2016 at 9:49 PM David Mertz
Moreover, this "magical flatten" operator will crash in bad ways that a regular flatten() will not. I.e. this is fine (if strange):
three_inf = (count(), count(), count()) comp = (x for x in flatten(three_inf)) next(comp) 0 next(comp) 1
It's hard to see how that won't blow up under the new syntax (i.e. generally for all infinite sequences).
The proposed semantics replace the asterisk with a "yield from" in a generator, so it should work just fine.
Elazar