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

Method insert

Lib/_pyrepl/reader.py:569–573  ·  view source on GitHub ↗

Insert 'text' at the insertion point.

(self, text: str | list[str])

Source from the content-addressed store, hash-verified

567 return prompt_len + sum(char_widths[:pos]), y
568
569 def insert(self, text: str | list[str]) -> None:
570 """Insert 'text' at the insertion point."""
571 self.buffer[self.pos : self.pos] = list(text)
572 self.pos += len(text)
573 self.dirty = True
574
575 def update_cursor(self) -> None:
576 """Move the cursor to reflect changes in self.pos"""

Callers 15

doMethod · 0.45
doMethod · 0.45
doMethod · 0.45
doMethod · 0.45
doMethod · 0.45
doMethod · 0.45
doMethod · 0.45
refreshMethod · 0.45
move_cursorMethod · 0.45
__sigwinchMethod · 0.45
doMethod · 0.45

Calls 1

listClass · 0.85

Tested by

no test coverage detected