A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-April/125145.html below:

[Python-Dev] Is file.readlines(sizehint=N) broken on 2.7?

[Python-Dev] Is file.readlines(sizehint=N) broken on 2.7? [Python-Dev] Is file.readlines(sizehint=N) broken on 2.7?R. David Murray rdmurray at bitdance.com
Fri Apr 5 21:10:36 CEST 2013
On Fri, 05 Apr 2013 20:24:43 +0200, =?ISO-8859-1?Q?Giampaolo_Rodol=E0?= <g.rodola at gmail.com> wrote:
> 2013/4/5 INADA Naoki <songofacandy at gmail.com>:
> > The builtin open() was replaced with io.open().
> > It's difference between file.readlines() and io.IOBase.readlines().
> 
> Should that justify this difference in behavior?

Yes.  The 'file' documentation for readlines says documents that the
argument is advisory and may be rounded up to an internal buffer size.

io's readlines, on the other hand, says no more lines will be read if
the total size of bytes read so far exceeds the hint.

So, different semantics.

> Apparently on 2.X sizehint does not have any effect as far as I can see.

Have you played with large enough hints/small enough buffers?

--David

More information about the Python-Dev mailing list

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