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

Method prepare

Lib/_pyrepl/historical_reader.py:304–318  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

302 self.history[:] = old_history
303
304 def prepare(self) -> None:
305 super().prepare()
306 try:
307 self.transient_history = {}
308 if self.next_history is not None and self.next_history < len(self.history):
309 self.historyi = self.next_history
310 self.buffer[:] = list(self.history[self.next_history])
311 self.pos = len(self.buffer)
312 self.transient_history[len(self.history)] = ""
313 else:
314 self.historyi = len(self.history)
315 self.next_history = None
316 except:
317 self.restore()
318 raise
319
320 def get_prompt(self, lineno: int, cursor_on_line: bool) -> str:
321 if cursor_on_line and self.isearch_direction != ISEARCH_DIRECTION_NONE:

Callers

nothing calls this directly

Calls 3

superClass · 0.85
listClass · 0.85
restoreMethod · 0.45

Tested by

no test coverage detected