A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2001-January/011271.html below:

[Patches] [Patch #102915] xreadlines : readlines :: xrange : range

[Python-Dev] RE: [Patches] [Patch #102915] xreadlines : readlines :: xrange : range [Python-Dev] RE: [Patches] [Patch #102915] xreadlines : readlines :: xrange : rangePaul Prescod paulp@ActiveState.com
Tue, 02 Jan 2001 02:06:24 -0800
Moshe Zadka wrote:
> 
> ...
> 
> 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?

Fileinput is inherently slow because there are too many layers of Python
code. I started to consider ways of inverting the logic so that it only
called into Python when it needed to switch files but it would have been
a much larger patch than Jeff's and I thought that a conservative
approach was important.

Fileinput should someday be optimized but we can easily get a
low-hanging fruit improvement with Jeff's patch.

 Paul Prescod



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4