I'm doing some I/O with Python 3 and noticed this:
fname = 'mbox.txt'
fh = open(fname)
sum( 1 for line in fh) # count lines
# Out[49]: 132045
sum( 1 for line in fh)
# Out[50]: 0
mbox.txt
is here, which should be trivial.
Does it mean the file object fh
expires after being used once? I read the documentation and didn't get it.