var ten_squares = [i * i for (i in range(0, 10))];
Take out the word
var, and that’s 100% valid Python (although Python can get by here with less parentheses and without the semicolon).
__iterator__ slot. Iterators just implement a
next() method, and raise
StopIteration when done. Generators turn functions into iterators by using the