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/090120.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
Fri Jun 19 02:50:27 CEST 2009
Lucas P Melo wrote:

> The problem is that the chosen 
> method to accomplish it would read 2 symbols (bytes) ahead and this guy 
> is using peek() to grab these 2 bytes. The program will seem to work 
> correctly most of the time, but on the 4095th byte read, he would grab 1 
> byte at most using peek()

That's exactly why I think the blocking version should
keep reading until the requested number of bytes is
available (or the buffer is full or EOF occurs).

In other words, the blocking version should be fully
deterministic given knowledge of the buffer size.

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