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

Method get_trimmed_history

Lib/_pyrepl/readline.py:175–182  ·  view source on GitHub ↗
(self, maxlength: int)

Source from the content-addressed store, hash-verified

173 return self.config.module_completer.get_completions(line)
174
175 def get_trimmed_history(self, maxlength: int) -> list[str]:
176 if maxlength >= 0:
177 cut = len(self.history) - maxlength
178 if cut < 0:
179 cut = 0
180 else:
181 cut = 0
182 return self.history[cut:]
183
184 def update_last_used_indentation(self) -> None:
185 indentation = _get_first_indentation(self.buffer)

Callers 2

write_history_fileMethod · 0.80
append_history_fileMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected