Em Qua, 2006-03-22 às 00:47 +0100, "Martin v. Löwis" escreveu: > Caleb Hattingh wrote: > > What does ".readlines()" do differently that makes it so much slower > > than ".read().splitlines(True)"? To me, the "one obvious way to do it" > > is ".readlines()". [snip] > Anyway, decompressing the entire file at one lets zlib operate at the > highest efficiency.
Then there should be a fast-path on readlines like this: def readlines(self, sizehint=None): if sizehint is None: return self.read().splitlines(True) # ... Is it okay? Or is there any embedded problem I couldn't see? -- Felipe. -- http://mail.python.org/mailman/listinfo/python-list