On Sat, Nov 22, 2014 at 2:58 AM, Steven D'Aprano <st...@pearwood.info> wrote:
> Since zip() is documented as
> halting on the shorter argument, it can't raise an exception. So what
> other options are there apart from silently consuming the value?

Sure, it's documented as doing that. But imagine something that isn't
a well-known function - all you have is someone writing a generator
that calls next() in multiple places. Is it obvious that it it'll
silently terminate as soon as any one of those iterators is exhausted?
In many cases, an exception (probably ValueError?) would be the most
obvious response.

ChrisA
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to