[... for row in open(filename).readlines()]
[... for row in open(filename)]
Additionally, this doesn't do what you think it does:
>>> header, *records = (row.strip().split(',') for row in f)
>>> gen = (row.strip().split(',') for row in f) >>> header, *records = next(gen)
Additionally, this doesn't do what you think it does:
Compare to this, using a variable for clarity: