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

Method readalllines

Lib/test/test_codecs.py:164–172  ·  view source on GitHub ↗
(input, keepends=True, size=None)

Source from the content-addressed store, hash-verified

162 return codecs.getreader(self.encoding)(stream)
163
164 def readalllines(input, keepends=True, size=None):
165 reader = getreader(input)
166 lines = []
167 while True:
168 line = reader.readline(size=size, keepends=keepends)
169 if not line:
170 break
171 lines.append(line)
172 return "|".join(lines)
173
174 s = "foo\nbar\r\nbaz\rspam\u2028eggs"
175 sexpected = "foo\n|bar\r\n|baz\r|spam\u2028|eggs"

Callers

nothing calls this directly

Calls 4

getreaderFunction · 0.85
readlineMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected