to catch and recover from StopIterations, use this:
try:
raise StopIteration
except StopIteration:
print 'caught StopIteration!' # verbose: sys.exc_info() requires
import sys-- http://mail.python.org/mailman/listinfo/python-list
to catch and recover from StopIterations, use this:
try:
raise StopIteration
except StopIteration:
print 'caught StopIteration!' # verbose: sys.exc_info() requires
import sys-- http://mail.python.org/mailman/listinfo/python-list