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

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jun 16 01:21:03 CEST 2009

Cameron Simpson wrote:

> It seems like whenever I want to do some kind of opportunistic but
> non-blocking stuff with a remote service

Do you actually do this with buffered streams? I find
it's better to steer well clear of buffered I/O objects
when doing non-blocking stuff, because they don't play
well with other things like select().

Anyhow, I wouldn't be opposed to having a way of looking
into the buffer, but it should be a separate API  --
preferably with a better name than peek0(), which gives
no clue at all about what it does differently from peek().


More information about the Python-Dev mailing list