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

Method readline

Lib/bz2.py:194–206  ·  view source on GitHub ↗

Read a line of uncompressed bytes from the file. The terminating newline (if present) is retained. If size is non-negative, no more than size bytes will be read (in which case the line may be incomplete). Returns b'' if already at EOF.

(self, size=-1)

Source from the content-addressed store, hash-verified

192 return self._buffer.readinto(b)
193
194 def readline(self, size=-1):
195 """Read a line of uncompressed bytes from the file.
196
197 The terminating newline (if present) is retained. If size is
198 non-negative, no more than size bytes will be read (in which
199 case the line may be incomplete). Returns b'' if already at EOF.
200 """
201 if not isinstance(size, int):
202 if not hasattr(size, "__index__"):
203 raise TypeError("Integer argument expected")
204 size = size.__index__()
205 self._check_can_read()
206 return self._buffer.readline(size)
207
208 def readlines(self, size=-1):
209 """Read a list of lines of uncompressed bytes from the file.

Callers

nothing calls this directly

Calls 2

_check_can_readMethod · 0.80
__index__Method · 0.45

Tested by

no test coverage detected