Imagine you want to write code that iterates over any fighter. Usually you just write a statement foror understanding, but instead explicitly do what you fordo under the covers to make things more obvious:
i = iter(iterable)
while True:
try:
val = next(i)
except StopIteration:
break
else:
do_stuff(val)
, , , , .
, , iter(iterable) , .
, iter ? , , , __len__ __getitem__, __iter__, , , a __next__, __iter__? , , , Python . , - , ( ) , , .