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

Function replace_import_hook

IPython/lib/deepreload.py:41–47  ·  view source on GitHub ↗
(new_import)

Source from the content-addressed store, hash-verified

39
40@contextmanager
41def replace_import_hook(new_import):
42 saved_import = builtin_mod.__import__
43 builtin_mod.__import__ = new_import
44 try:
45 yield
46 finally:
47 builtin_mod.__import__ = saved_import
48
49def get_parent(globals, level):
50 """

Callers 1

reloadFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…