Is there an expression for an infinite iterator?

itertools provides three infinite iterators:

I don’t know of any others in the standard library.


Since you asked for a one-liner:

__import__("itertools").count()

Leave a Comment