Marcel Martin <pyt...@marcelm.net> added the comment:

I opened a PR, but I now wonder whether the missing peek() is by design.

First, I noticed that instead of using BytesIO directly, I can wrap the 
instance in an io.BufferedReader, which does have peek(). (It’s just a bit 
inconvenient.)

The second thing is that BytesIO is currently documented to inherit from 
BufferedIOBase, but if peek() is implemented, one could argue that BytesIO now 
should inherit from BufferedReader because it then has all the methods. And 
that seems to great a change from my perspective.

I’ll defer to someone more knowledgeable and do not mind at all if this issue 
is closed without action.

----------

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

Reply via email to