O'Reilly logo
  • You Wang thinks this is interesting:

When we use a for item in iterable loop, Python in effect calls iter(iterable) to get an iterator. This iterator’s __next__() method is then called at each loop iteration to get the next item, and when the StopIteration exception is raised, it is caught and the loop is terminated.


Cover of Programming in Python 3: A Complete Introduction to the Python Language, Second Edition


so the implementation can be a linked list