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

Method readline

Lib/test/mock_socket.py:24–30  ·  view source on GitHub ↗
(self, limit=-1)

Source from the content-addressed store, hash-verified

22 def __init__(self, lines):
23 self.lines = lines
24 def readline(self, limit=-1):
25 result = self.lines.pop(0) + b'\r\n'
26 if limit >= 0:
27 # Re-insert the line, removing the \r\n we added.
28 self.lines.insert(0, result[limit:-2])
29 result = result[:limit]
30 return result
31 def close(self):
32 pass
33

Callers 15

readalllinesMethod · 0.45
test_readlineMethod · 0.45
test_readlinequeueMethod · 0.45
test_bug1098990_aMethod · 0.45
test_bug1098990_bMethod · 0.45
test_readlineMethod · 0.45
test_seeking_readMethod · 0.45
test_seeking_writeMethod · 0.45
test_poll2Method · 0.45

Calls 2

popMethod · 0.45
insertMethod · 0.45

Tested by 15

readalllinesMethod · 0.36
test_readlineMethod · 0.36
test_readlinequeueMethod · 0.36
test_bug1098990_aMethod · 0.36
test_bug1098990_bMethod · 0.36
test_readlineMethod · 0.36
test_seeking_readMethod · 0.36
test_seeking_writeMethod · 0.36
test_poll2Method · 0.36