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.
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.