MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / readline

Method readline

tools/python-3.11.9-amd64/Lib/idlelib/run.py:497–511  ·  view source on GitHub ↗
(self, size=-1)

Source from the content-addressed store, hash-verified

495 return result
496
497 def readline(self, size=-1):
498 if self.closed:
499 raise ValueError("read from closed file")
500 if size is None:
501 size = -1
502 elif not isinstance(size, int):
503 raise TypeError('must be int, not ' + type(size).__name__)
504 line = self._line_buffer or self.shell.readline()
505 if size < 0:
506 size = len(line)
507 eol = line.find('\n', 0, size)
508 if eol >= 0:
509 size = eol + 1
510 self._line_buffer = line[size:]
511 return line[:size]
512
513 def close(self):
514 self.shell.close()

Callers 3

test_readlineMethod · 0.95
test_closeMethod · 0.95
readMethod · 0.45

Calls 2

typeClass · 0.50
findMethod · 0.45

Tested by 2

test_readlineMethod · 0.76
test_closeMethod · 0.76