Looking at solutions to reading in a file in Python, every time the newline character should be stripped off:
In [5]: [line for line in open("text.txt", "r")]
Out[5]: ['line1\n', 'line2']
The intuitive behavior (judging by the popularity of some questions (1, 2) about this) would be to just yield the stripped lines.
What is the rationale behind this?