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

Method save_to

bpython/history.py:216–223  ·  view source on GitHub ↗
(
        self, fd: TextIO, entries: list[str] | None = None, lines: int = 0
    )

Source from the content-addressed store, hash-verified

214 self.save_to(hfile, self.entries, lines)
215
216 def save_to(
217 self, fd: TextIO, entries: list[str] | None = None, lines: int = 0
218 ) -> None:
219 if entries is None:
220 entries = self.entries
221 for line in entries[-lines:]:
222 fd.write(line)
223 fd.write("\n")
224
225 def append_reload_and_write(
226 self, s: str, filename: Path, encoding: str

Callers 2

saveMethod · 0.95

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected