MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_history_item

Method get_history_item

Lib/_pyrepl/readline.py:463–468  ·  view source on GitHub ↗
(self, index: int)

Source from the content-addressed store, hash-verified

461 del self.get_reader().history[:]
462
463 def get_history_item(self, index: int) -> str | None:
464 history = self.get_reader().history
465 if 1 <= index <= len(history):
466 return history[index - 1]
467 else:
468 return None # like readline.c
469
470 def remove_history_item(self, index: int) -> None:
471 history = self.get_reader().history

Callers

nothing calls this directly

Calls 2

get_readerMethod · 0.95
lenFunction · 0.85

Tested by

no test coverage detected