We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0be970e commit e2d3929Copy full SHA for e2d3929
1 file changed
Doc/library/io.rst
@@ -773,11 +773,11 @@ than raw I/O does.
773
774
.. method:: peek(size=0, /)
775
776
- Return bytes from the current position onwards without advancing the position.
777
- At least one byte of data is returned if not at EOF.
+ Return a copy of the buffer from the current position onwards without advancing the position.
+
778
+ If *size* is zero or omitted, the returned :class:`bytes` object extends to EOF.
779
+ Otherwise, at most *size* bytes are returned.
780
Return an empty :class:`bytes` object at EOF.
- The number of read bytes depends on the buffer size
- and the current position in the internal buffer.
781
782
.. versionadded:: next
783
0 commit comments