MCPcopy Create free account
hub / github.com/ipython/ipython / reload

Function reload

IPython/lib/deepreload.py:327–341  ·  view source on GitHub ↗

Recursively reload all modules used in the given module. Optionally takes a list of modules to exclude from reloading. The default exclude list contains sys, __main__, and __builtin__, to prevent, e.g., resetting display, exception, and io hooks.

(module, exclude=('sys', 'os.path', 'builtins', '__main__',
                            'numpy', 'numpy._globals'))

Source from the content-addressed store, hash-verified

325
326# Replacement for reload()
327def reload(module, exclude=('sys', 'os.path', 'builtins', '__main__',
328 'numpy', 'numpy._globals')):
329 """Recursively reload all modules used in the given module. Optionally
330 takes a list of modules to exclude from reloading. The default exclude
331 list contains sys, __main__, and __builtin__, to prevent, e.g., resetting
332 display, exception, and io hooks.
333 """
334 global found_now
335 for i in exclude:
336 found_now[i] = 1
337 try:
338 with replace_import_hook(deep_import_hook):
339 return deep_reload_hook(module)
340 finally:
341 found_now = {}

Callers 7

teardown_environmentFunction · 0.85
test_get_xdg_dir_0Function · 0.85
test_get_xdg_dir_1Function · 0.85
test_get_xdg_dir_2Function · 0.85
test_get_xdg_dir_3Function · 0.85
reload_extensionMethod · 0.85
superreloadFunction · 0.85

Calls 2

replace_import_hookFunction · 0.85
deep_reload_hookFunction · 0.85

Tested by 5

teardown_environmentFunction · 0.68
test_get_xdg_dir_0Function · 0.68
test_get_xdg_dir_1Function · 0.68
test_get_xdg_dir_2Function · 0.68
test_get_xdg_dir_3Function · 0.68