Why do we need readlines() when we can iterate over the file handle itself?

Viewed 10138

In Python, after

fh = open('file.txt')

one may do the following to iterate over lines:

for l in fh:
    pass

Then why do we have fh.readlines()?

3 Answers
Related