itertools.izip brokeness

bonono at bonono at
Wed Jan 4 01:01:05 EST 2006

r... at wrote:
> It is clear that there is a real need for iterating in parallel
> over multiple iterators to the end of the longest one.  Why
> does something that stops at the shortest get included in
> the standard library, but one that stops after the longest
> doesn't?  Is there any hope for something like this being
> included in 2.5?
I wonder as well. map(None, ) does what you want, but it is not lazy.
imap(None,) for some reason don't do the same thing as map. And if you
don't want None as the sentinel, you can just write your own lambda(see
my other post). So for non-lazy need, map already supports what you

The suggestion of "unget" in iterator is interesting too, as I also
once wrote a restartable iterator wrapper using tee() though later
scrap it as I found that turning them into list is easier so long I
don't need the lazy version.

More information about the Python-list mailing list