Python for loop implementation

No, the second format is quite different.

The for loop calls iter() on the to-loop-over sequence, and uses next() calls on the result. Consider it the equivalent of:

iterable = iter(cases):
while True:
    try:
        case = next(iterable)
    except StopIteration:
        break

    # blah

The result of calling iter() on a list is a list iterator object:

>>> iter([])
<list_iterator object at 0x10fcc6a90>

This object keeps a reference to the original list and keeps track of the index it is at. That index starts at 0 and increments until it the list has been iterated over fully.

Different objects can return different iterators with different behaviours. With threading mixed in, you could end up replacing cases with something else, but the iterator would still reference the old sequence.