I think the idiom is too use `next(iter(lines))`. `next` is a builtin from Python 2.6 and on if I remember correctly.