Question 6/13 fast.ai v3 lecture 9

In Python, what happens when we say for something in something_else?

Answer

iter is called on something_else and each iteration next() is called on the returned iterator

Screenshot

Relevant part of lecture

supplementary material

What are coroutines? (a short youtube video)
Found coroutines interesting? Here is a great Quora answer on what continuation-passing style in functional programming is.
How does Python go about handling the StopIteration Exception?