Iterators in Python
Contents
1. for "x in y" loops
for X in Y loops are actually:
itr = iter(Y) # Which, if you look deeply is: itr = Y.__iter__
try:
while (True):
val = itr.next()
do_something_with(val)
except StopIteration:
pass
return
