On Sun, Aug 11, 2013 at 6:58 PM, Armin Ronacher
<armin.ronac...@active-4.com> wrote:
> Hi,
>
>
> On 11/08/2013 23:47, Daniel Micay wrote:
>>
>> Python does not make the guarantee, and the functions like `zip` there
>> will continue calling the underlying iterators.
>
> That's incorrect.  Python's definition of the iterator protocol is that an
> iterator not continue raising StopIteration is in violation of the protocol.
>
>
> Regards,
> Armin

If the underlying iterators continue to raise StopIteration, zip will
continue to do so. It will *not* stop calling __next__ on them, and
will happily start yielding elements again if they all do. The other
itertools adaptors are the same way.

Perhaps it's a violation of the protocol to stop raising
StopIteration, but zip will continue to cause side effects like I/O.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to