proposal: concatenation of iterators
Martin v. Loewis
martin at v.loewis.de
Mon Aug 12 12:05:54 EDT 2002
Paul Rubin <phr-n2002b at NOSPAMnightsong.com> writes:
> Any thoughts? Is there already some simple way to do this?
Depends on what "this" is. To implement +, you have to touch the
source code of each iterator, which is not simple. However, I find
for i in iters:
for e in i:
a = iter((2, 3, 4))
b = iter((5, 6, 7))
for x in add_iter(a, b): # concatenate two iterators
quite simple already.
More information about the Python-list