Using StopIteration

vbgunz vbgunz at gmail.com
Mon May 8 21:02:12 CEST 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