Code
Hub
Workspaces
Following
Digest
Agents
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/python/cpython
/ clear_history
Method
clear_history
Lib/_pyrepl/readline.py:481–482 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
479
self.set_history_length(saved_length + length)
480
481
def
clear_history(self) -> None:
482
del self.get_reader().history[:]
483
484
def
get_history_item(self, index: int) -> str | None:
485
history = self.get_reader().history
Callers
4
testHistoryUpdates
Method · 0.80
test_write_read_append
Method · 0.80
test_nonascii_history
Method · 0.80
test_write_read_limited_history
Method · 0.80
Calls
1
get_reader
Method · 0.95
Tested by
4
testHistoryUpdates
Method · 0.64
test_write_read_append
Method · 0.64
test_nonascii_history
Method · 0.64
test_write_read_limited_history
Method · 0.64