Python 3 read() function

Terry Reedy tjreedy at udel.edu
Thu Dec 4 14:55:08 EST 2008


Jean-Paul Calderone wrote:
> On Thu, 04 Dec 2008 14:25:48 -0500, Terry Reedy <tjreedy at udel.edu> wrote:
>> [snip]
>>
>> In my test, I read Python25.chm with 2.5 and Python30.chm with 3.0.
>>
>> Rereading Python30.chm without closing *is* much faster.
>> >>> f=open('Doc/Python30.chm','rb')
>> >>> d=f.read()
>> >>> d=f.read()
>> >>> d=f.read()
> 
> Did you think about what this does?

Whoops ;-)
f.seek(0) first and it is maybe a bit faster, but not 'much'.




More information about the Python-list mailing list