Martin Panter added the comment:

Is the current documentation as accurate as it can be?

“The number of bytes returned may be less or more than requested”

To me this has always made this method practically useless. A valid 
implementation could just always return b"". I noticed the BZ2File.peek() 
documentation (BZ2File is apparently trying to imitate BufferedReader) is 
slightly more useful:

“At least one byte of data will be returned (unless at EOF)”

That could be used for (say) peeking for a LF following a CR. But still the 
“size” parameter does not seem very useful. In fact, LZMAFile.peek() says the 
size is ignored.

----------
nosy: +vadmium
versions: +Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5811>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to