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

Method read

Lib/bz2.py:165–172  ·  view source on GitHub ↗

Read up to size uncompressed bytes from the file. If size is negative or omitted, read until EOF is reached. Returns b'' if the file is already at EOF.

(self, size=-1)

Source from the content-addressed store, hash-verified

163 return self._buffer.peek(n)
164
165 def read(self, size=-1):
166 """Read up to size uncompressed bytes from the file.
167
168 If size is negative or omitted, read until EOF is reached.
169 Returns b'' if the file is already at EOF.
170 """
171 self._check_can_read()
172 return self._buffer.read(size)
173
174 def read1(self, size=-1):
175 """Read up to size uncompressed bytes, while trying to avoid

Callers 4

testSeekableMethod · 0.95
testReadableMethod · 0.95
testWritableMethod · 0.95
testDecompressLimitedMethod · 0.95

Calls 1

_check_can_readMethod · 0.80

Tested by 4

testSeekableMethod · 0.76
testReadableMethod · 0.76
testWritableMethod · 0.76
testDecompressLimitedMethod · 0.76