def readlines(self, hint=-1):
# type: (int) -> List[bytes]
"""Read and return a list of lines from the stream. hint can be specified to control
the number of lines read: no more lines will be read if the total size (in bytes/
characters) of all lines so far exceeds hint.
:type hint: int
:returns: Lines of data
:rtype: list of bytes
"""
lines = []
for line in self: # type: ignore
lines.append(line)
if hint > 0 and len(lines) * io.DEFAULT_BUFFER_SIZE > hint:
break
return lines
评论列表
文章目录