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

Method get_trimmed_history

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

Source from the content-addressed store, hash-verified

162 return result
163
164 def get_trimmed_history(self, maxlength: int) -> list[str]:
165 if maxlength >= 0:
166 cut = len(self.history) - maxlength
167 if cut < 0:
168 cut = 0
169 else:
170 cut = 0
171 return self.history[cut:]
172
173 def update_last_used_indentation(self) -> None:
174 indentation = _get_first_indentation(self.buffer)

Callers 1

write_history_fileMethod · 0.80

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected