[Python-Dev] RE: [Patches] [Patch #102915] xreadlines : readlines :: xrange : range

Moshe Zadka moshez@zadka.site.co.il
Tue, 2 Jan 2001 17:24:40 +0200 (IST)

On Mon, 1 Jan 2001, Thomas Wouters <thomas@xs4all.net> wrote:

> As for speed (which stays a secondary or tertiary consideration at best) do
> we really need the xreadlines method to accomplish that ? Couldn't fileinput
> get almost the same performance using readlines() with a sizehint ? I

<aol>me too</aol>
Adding xreadlines() to the interface would break half a dozen file-objects all
around the world (just the standard library has StringIO, cStringIO,
GzipFile and probably some others I can't remember)

Adding .readlines(sizehint) to fileinput, and adding a function
to create something similar to fileinput from a file object (as opposed
to a file name) would help everyone, and doesn't seem to hard.
Is there a gotcha I'm just not seeing?

Moshe Zadka <sig@zadka.site.co.il>
This is a signature anti-virus. 
Please stop the spread of signature viruses!