MCPcopy Index your code
hub / github.com/python/cpython / peek

Method peek

Lib/lzma.py:190–199  ·  view source on GitHub ↗

Return buffered data without advancing the file position. Always returns at least one byte of data, unless at EOF. The exact number of bytes returned is unspecified.

(self, size=-1)

Source from the content-addressed store, hash-verified

188 return self._mode == _MODE_WRITE
189
190 def peek(self, size=-1):
191 """Return buffered data without advancing the file position.
192
193 Always returns at least one byte of data, unless at EOF.
194 The exact number of bytes returned is unspecified.
195 """
196 self._check_can_read()
197 # Relies on the undocumented fact that BufferedReader.peek() always
198 # returns at least one byte (except at EOF)
199 return self._buffer.peek(size)
200
201 def read(self, size=-1):
202 """Read up to size uncompressed bytes from the file.

Callers

nothing calls this directly

Calls 1

_check_can_readMethod · 0.80

Tested by

no test coverage detected