MCPcopy Index your code
hub / github.com/bpython/bpython / append_to

Method append_to

bpython/history.py:59–69  ·  view source on GitHub ↗
(self, entries: list[str], line: str)

Source from the content-addressed store, hash-verified

57 self.append_to(self.entries, line)
58
59 def append_to(self, entries: list[str], line: str) -> None:
60 line = line.rstrip("\n")
61 if line:
62 if not self.duplicates:
63 # remove duplicates
64 try:
65 while True:
66 entries.remove(line)
67 except ValueError:
68 pass
69 entries.append(line)
70
71 def first(self) -> str:
72 """Move back to the beginning of the history."""

Callers 4

appendMethod · 0.95
load_fromMethod · 0.95
test_saveMethod · 0.95

Calls 1

appendMethod · 0.80

Tested by 1

test_saveMethod · 0.76