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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com