This is a question about Python internals. The following code is taken from this video about laziness in python: The sieve function generates prime numbers lazily (read this for the original concept). Conceptually, we add filters to the “sieve”, so every number (say, 10) is tested against all the previously found prime numbers (so 2, 3, 5 and 7) until