Is there a good reason why when you try to take an element from an 
already exausted iterator, it throws StopIteration instead of some other 
exception ? I've lost quite some times already because I was using a lot 
of iterators and I forgot that that specific function parameter was one.

Exemple :

 >>> def f(i):
...     print list(i)
...     print list(i)
...
 >>> f(iter(range(2)))
[0, 1]
[]
 >>>

This is using Python 2.4.2
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to