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

Method _load_extension

IPython/core/extensions.py:69–82  ·  view source on GitHub ↗
(self, module_str: str)

Source from the content-addressed store, hash-verified

67 raise
68
69 def _load_extension(self, module_str: str):
70 if module_str in self.loaded:
71 return "already loaded"
72
73 assert self.shell is not None
74
75 with self.shell.builtin_trap:
76 if module_str not in sys.modules:
77 mod = import_module(module_str)
78 mod = sys.modules[module_str]
79 if self._call_load_ipython_extension(mod):
80 self.loaded.add(module_str)
81 else:
82 return "no load function"
83
84 def unload_extension(self, module_str: str):
85 """Unload an IPython extension by its module name.

Callers 1

load_extensionMethod · 0.95

Calls 2

addMethod · 0.45

Tested by

no test coverage detected