title: Recursive version of 'reload'
body: <p>When I'm developing Python code, I usually test it in an ad-hoc way in the interpreter. I'll <code>import some_module</code>, test it, find a bug, fix the bug and save, and then use the built-in <code>reload</code> function to <code>reload(some_module)</code> and test again.</p>
  
  <p>However, suppose that in <code>some_module</code> I have <code>import some_other_module</code>, and while testing <code>some_module</code> I discover a bug in <code>some_other_module</code> and fix it. Now calling <code>reload(some_module)</code> won't recursively re-import <code>some_other_module</code>. I have to either manually reimport the dependency (by doing something like <code>reload(some_module.some_other_module)</code>, or <code>import some_other_module; reload(some_other_module)</code>, or, if I've changed a whole bunch of dependencies and lost track of what I need to reload, I need to restart the entire interpreter.</p>
  
  <p>What'd be more convenient is if there were some <code>recursive_reload</code> function, and I could just do <code>recursive_reload(some_module)</code> and have Python not only reload <code>some_module</code>, but also recursively reload every module that <code>some_module</code> imports (and every module that each of those modules imports, and so on) so that I could be sure that I wasn't using an old version of any of the other modules upon which <code>some_module</code> depends.</p>
  
  <p>I don't think there's anything built in to Python that behaves like the <code>recursive_reload</code> function I describe here, but is there an easy way to hack such a thing together?</p>