MCPcopy Index your code
hub / github.com/ipython/ipython / reset

Method reset

IPython/core/history.py:800–815  ·  view source on GitHub ↗

Clear the session history, releasing all object references, and optionally open a new session.

(self, new_session: bool = True)

Source from the content-addressed store, hash-verified

798 )
799
800 def reset(self, new_session: bool = True) -> None:
801 """Clear the session history, releasing all object references, and
802 optionally open a new session."""
803 self.output_hist.clear()
804 self.outputs.clear()
805 self.exceptions.clear()
806
807 # The directory history can't be completely empty
808 self.dir_hist[:] = [Path.cwd()]
809
810 if new_session:
811 if self.session_number:
812 self.end_session()
813 self.input_hist_parsed[:] = [""]
814 self.input_hist_raw[:] = [""]
815 self.new_session()
816
817 # ------------------------------
818 # Methods for retrieving history

Callers 1

debuggerMethod · 0.45

Calls 2

end_sessionMethod · 0.95
new_sessionMethod · 0.95

Tested by

no test coverage detected