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

Cameron Simpson cs at zip.com.au
Mon Jun 15 02:34:07 CEST 2009


On 14Jun2009 09:21, Benjamin Peterson <benjamin at python.org> wrote:
| 2009/6/14 Cameron Simpson <cs at zip.com.au>:
| > On 14Jun2009 15:16, I wrote:
| > | Is it possible to access the buffer? I see nothing in the docs.
| >
| > I've just found getvalue() in IOBase. Forget I said anything.
| > It seems to be my day for that kind of post:-(
| 
| Where are you seeing this? Only BytesIO and StringIO have a getvalue() method.

I had thought I'd traced it by class inheritance. But I got BytesIO and
IOBase confused. So: no getvalue then. So probably there is a case for
peek0(), which never does a raw read.

Thoughts?
-- 
Cameron Simpson <cs at zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/

I was gratified to be able to answer promptly and I did.
I said I didn't know.   - Mark Twain


More information about the Python-Dev mailing list