thanks. I was looking for scanl in itertools but can't find it so I
implement my own then run into some subtle bugs which first made me
think my scanl is the problem. Then notice my wrong perception about
generator(and iterable in general, though the built-in iterables like
list, dict don't seem to have this characteristic).

Simon Percivall wrote:
> If you find that you want to iterate over an iterable multiple times,
> have a look at the solution that the tee() function in the itertools
> module provides (http://docs.python.org/lib/itertools-functions.html).
> (Have a look at the rest of the itertools module as well, for that
> matter.)

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to