IPython Documentation

Table Of Contents

Previous topic

lib.clipboard

Next topic

lib.demo

This Page

lib.deepreload

Module: lib.deepreload

A module to change reload() so that it acts recursively. To enable it type:

import __builtin__, deepreload
__builtin__.reload = deepreload.reload

You can then disable it with:

__builtin__.reload = deepreload.original_reload

Alternatively, you can add a dreload builtin alongside normal reload with:

__builtin__.dreload = deepreload.reload

This code is almost entirely based on knee.py from the standard library.

Functions

IPython.lib.deepreload.deep_import_hook(name, globals=None, locals=None, fromlist=None, level=-1)
IPython.lib.deepreload.deep_reload_hook(module)
IPython.lib.deepreload.determine_parent(globals)
IPython.lib.deepreload.ensure_fromlist(m, fromlist, recursive=0)
IPython.lib.deepreload.find_head_package(parent, name)
IPython.lib.deepreload.import_module(partname, fqname, parent)
IPython.lib.deepreload.load_tail(q, tail)
IPython.lib.deepreload.reload(module, exclude=['sys', '__builtin__', '__main__'])

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.