Using StopIteration

vbgunz vbgunz at gmail.com
Mon May 8 15:02:12 EDT 2006


to catch and recover from StopIterations, use this:

try:
    raise StopIteration
except StopIteration:
    print 'caught StopIteration!'  # verbose: sys.exc_info() requires
import sys




More information about the Python-list mailing list