MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / readline

Method readline

gridfs/synchronous/grid_file.py:1544–1549  ·  view source on GitHub ↗

Read one line or up to `size` bytes from the file. :param size: the maximum number of bytes to read

(self, size: int = -1)

Source from the content-addressed store, hash-verified

1542 return [x for x in self] # noqa: C416, RUF100
1543
1544 def readline(self, size: int = -1) -> bytes:
1545 """Read one line or up to `size` bytes from the file.
1546
1547 :param size: the maximum number of bytes to read
1548 """
1549 return self._read_size_or_line(size=size, line=True)
1550
1551 def readlines(self, size: int = -1) -> list[bytes]:
1552 """Read one line or up to `size` bytes from the file.

Callers 7

__next__Method · 0.95
test_readlineMethod · 0.95
test_readlinesMethod · 0.95
test_corrupt_chunkMethod · 0.45
test_corrupt_chunkMethod · 0.45
test_corrupt_chunkMethod · 0.45
test_corrupt_chunkMethod · 0.45

Calls 1

_read_size_or_lineMethod · 0.95

Tested by 6

test_readlineMethod · 0.76
test_readlinesMethod · 0.76
test_corrupt_chunkMethod · 0.36
test_corrupt_chunkMethod · 0.36
test_corrupt_chunkMethod · 0.36
test_corrupt_chunkMethod · 0.36