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

Method do

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

Source from the content-addressed store, hash-verified

197
198class yank_pop(YankCommand):
199 def do(self) -> None:
200 r = self.reader
201 b = r.buffer
202 if not r.kill_ring:
203 r.error("nothing to yank")
204 return
205 if not is_yank(r.last_command):
206 r.error("previous command was not a yank")
207 return
208 repl = len(r.kill_ring[-1])
209 r.kill_ring.insert(0, r.kill_ring.pop())
210 t = r.kill_ring[-1]
211 b[r.pos - repl : r.pos] = t
212 r.pos = r.pos - repl + len(t)
213 r.dirty = True
214
215
216class interrupt(FinishCommand):

Callers

nothing calls this directly

Calls 4

is_yankFunction · 0.85
errorMethod · 0.45
insertMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected