This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients abacabadabacaba, docs@python, martin.panter, xiang.zhang
Date 2016-10-14.22:20:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The peek() method was originally added by Issue 9962, where Antoine was trying to imitate the BufferedReader.peek() API. However because “the number of bytes returned may be more or less than requested”, I never understood what this methods were good for; see also Issue 5811.

I think we could at least remove the claim about “at most one single read”. That is just describing an internal detail.

The documentation for bzip and LZMA is slightly more useful IMO because it says “at least one byte of data will be returned, unless EOF has been reached”. This guarantee is actually missing from the underlying BufferedReader.peek() documentation, though I think both io and _pyio implement it.
Date User Action Args
2016-10-14 22:20:07martin.pantersetrecipients: + martin.panter, abacabadabacaba, docs@python, xiang.zhang
2016-10-14 22:20:07martin.pantersetmessageid: <>
2016-10-14 22:20:07martin.panterlinkissue28445 messages
2016-10-14 22:20:07martin.pantercreate