Unbounded range()

You’re describing the basic use of itertools.count:

import itertools
squares = (x*x for x in itertools.count())

Leave a Comment