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

Method do

Lib/_pyrepl/commands.py:420–439  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

418
419class delete(EditCommand):
420 def do(self) -> None:
421 r = self.reader
422 b = r.buffer
423 if self.event[-1] == "\004":
424 if b and b[-1].endswith("\n"):
425 self.finish = True
426 elif (
427 r.pos == 0
428 and len(b) == 0 # this is something of a hack
429 ):
430 r.update_screen()
431 r.console.finish()
432 raise EOFError
433
434 for i in range(r.get_arg()):
435 if r.pos != len(b):
436 del b[r.pos]
437 r.dirty = True
438 else:
439 self.reader.error("end of buffer")
440
441
442class accept(FinishCommand):

Callers

nothing calls this directly

Calls 5

update_screenMethod · 0.80
get_argMethod · 0.80
endswithMethod · 0.45
finishMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected