Skip to content

Commit eaa7672

Browse files
committed
Document BytesIO.peek()
1 parent 50a2cfb commit eaa7672

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
@@ -739,6 +739,12 @@ than raw I/O does.
739739

740740
Return :class:`bytes` containing the entire contents of the buffer.
741741

742+
.. method:: peek(size=0, /)
743+
744+
.. versionadded:: 3.12
745+
746+
Return bytes from the current position onwards but without advancing the
747+
position. The number of bytes returned may be less or more than requested.
742748

743749
.. method:: read1(size=-1, /)
744750

0 commit comments

Comments
 (0)