for line in lines:

Where lines is a generator.