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

Method readline

Lib/idlelib/run.py:508–522  ·  view source on GitHub ↗
(self, size=-1)

Source from the content-addressed store, hash-verified

506 return result
507
508 def readline(self, size=-1):
509 if self.closed:
510 raise ValueError("read from closed file")
511 if size is None:
512 size = -1
513 elif not isinstance(size, int):
514 raise TypeError('must be int, not ' + type(size).__name__)
515 line = self._line_buffer or self.shell.readline()
516 if size < 0:
517 size = len(line)
518 eol = line.find('\n', 0, size)
519 if eol >= 0:
520 size = eol + 1
521 self._line_buffer = line[size:]
522 return line[:size]
523
524 def close(self):
525 self.shell.close()

Callers 3

test_readlineMethod · 0.95
test_closeMethod · 0.95
readMethod · 0.45

Calls 1

findMethod · 0.45

Tested by 2

test_readlineMethod · 0.76
test_closeMethod · 0.76