Skip to content

Commit b3f3c3d

Browse files
committed
Document BytesIO.peek()
1 parent acdfe2e commit b3f3c3d

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Doc/library/io.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,12 @@ than raw I/O does.
728728

729729
Return :class:`bytes` containing the entire contents of the buffer.
730730

731+
.. method:: peek(size=0, /)
732+
733+
.. versionadded:: 3.12
734+
735+
Return bytes from the current position onwards but without advancing the
736+
position. The number of bytes returned may be less or more than requested.
731737

732738
.. method:: read1(size=-1, /)
733739

0 commit comments

Comments
 (0)