MCPcopy Index your code
hub / github.com/RustPython/RustPython / readalllines

Method readalllines

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

getreaderFunction · 0.50
readlineMethod · 0.45
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected