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/2009-June/090024.html below:

[Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

[Python-Dev] io.BufferedReader.peek() Behaviour in python3.1 [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1Greg Ewing greg.ewing at canterbury.ac.nz
Sun Jun 14 02:33:35 CEST 2009
Antoine Pitrou wrote:
> The original docstring for peek() says:
> 
>         ...we
>         do at most one raw read to satisfy it.
> 
> In that light, I'm not sure it's a bug

It may be behaving according to the docs, but is that
behaviour useful?

Seems to me that if you're asking for n bytes, then it's
because you're doing some kind of parsing that requires
lookahead, and nothing less than n bytes will do.

I think it would be more useful if the "at most one
raw read" part were dropped. That would give it the
kind of deterministic behaviour generally expected
when dealing with buffered streams.

-- 
Greg
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