Unbounded range() June 8, 2023 by Tarik You’re describing the basic use of itertools.count: import itertools squares = (x*x for x in itertools.count())