Jack Diederich <jackd...@gmail.com> added the comment:

The code that raises the error is in ceval.c which is a critical path. 
The raise is done as soon the iterator has one more item than is needed
(see Daniel Diniz's comments on infinite iterators).  While the check
could return more useful information for known non-infinite iterators
(tuples, lists, etc) it would have to do a big if/else for all the core
types (but excluding their subclasses!).  If someone wants to submit
that patch and a benchmark that shows no slowdown I'll reopen the bug.

Until then I'm closing as WONTFIX.

----------
nosy: +jackdied
resolution:  -> wont fix
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue3071>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to