File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -773,9 +773,11 @@ than raw I/O does.
773773
774774 .. method :: peek(size=0, /)
775775
776- Return a copy of the buffer from the current position onwards without advancing the position.
776+ Return a copy of the buffer from the current position onwards without
777+ advancing the position.
777778
778- If *size * is less than one or omitted, at most `DEFAULT_BUFFER_SIZE ` bytes are returned.
779+ If *size * is less than one or omitted, at most
780+ :data: `DEFAULT_BUFFER_SIZE ` bytes are returned.
779781 Otherwise, at most *size * bytes are returned.
780782 Return an empty :class: `bytes ` object at EOF.
781783
Original file line number Diff line number Diff line change 9696io
9797--
9898
99- * Add :meth: `io.BytesIO.peek `.
99+ * Add :meth: `io.BytesIO.peek ` method to read without advancing position .
100100 (Contributed by Marcel Martin in :gh: `90533 `.)
101101
102102lzma
Original file line number Diff line number Diff line change @@ -619,7 +619,8 @@ def test_peek(self):
619619 self .assertEqual (memio .peek (), buf [:io .DEFAULT_BUFFER_SIZE ])
620620 self .assertEqual (memio .peek (0 ), buf [:io .DEFAULT_BUFFER_SIZE ])
621621 self .assertEqual (memio .peek (- 1 ), buf [:io .DEFAULT_BUFFER_SIZE ])
622- self .assertEqual (memio .peek (io .DEFAULT_BUFFER_SIZE + 100 ), buf [:io .DEFAULT_BUFFER_SIZE + 100 ])
622+ self .assertEqual (memio .peek (io .DEFAULT_BUFFER_SIZE + 100 ),
623+ buf [:io .DEFAULT_BUFFER_SIZE + 100 ])
623624 self .assertEqual (memio .peek (io .DEFAULT_BUFFER_SIZE * 100 ), buf )
624625
625626 # Current position beyond buffer end
Original file line number Diff line number Diff line change 1- Add :meth: `io.BytesIO.peek `.
1+ Add :meth: `io.BytesIO.peek ` method to read without advancing position .
You can’t perform that action at this time.
0 commit comments