MCPcopy
hub / github.com/prompt-toolkit/ptpython / _add_to_namespace

Method _add_to_namespace

src/ptpython/repl.py:407–418  ·  view source on GitHub ↗

Add ptpython built-ins to global namespace.

(self)

Source from the content-addressed store, hash-verified

405 output.flush()
406
407 def _add_to_namespace(self) -> None:
408 """
409 Add ptpython built-ins to global namespace.
410 """
411 globals = self.get_globals()
412
413 # Add a 'get_ptpython', similar to 'get_ipython'
414 def get_ptpython() -> PythonInput:
415 return self
416
417 globals["get_ptpython"] = get_ptpython
418 globals["exit"] = exit()
419
420 def _remove_from_namespace(self) -> None:
421 """

Callers 2

runMethod · 0.95
run_asyncMethod · 0.95

Calls 2

exitClass · 0.85
get_globalsMethod · 0.80

Tested by

no test coverage detected