You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
_pyio.BytesIO.peek() returns bytearray instead of bytes #155389
_pyio.BytesIO.peek() returns a bytearray, while io.BytesIO.peek() returns bytes, which is what Doc/library/io.rst documents. It also rejects an __index__-able size that the C version accepts.
io peek() -> bytes
io peek(Idx()) -> b'abc'
_pyio peek() -> bytearray
_pyio peek(Idx()) -> TypeError: '<' not supported between instances of 'Idx' and 'int'
Activity
gh-155389: Return bytes from _pyio.BytesIO.peek() (GH-155390)