Reloading python module with flattened namespace
<p>I have a package with a similar structure as scipy/numpy, where you have a few main submodules, and each submodule contains functions from various files that have been flattened into the same namespace. Let's say</p>

<pre><code>package/
  sub1/
    __init__.py
    file1.py
    file2.py
</code></pre>

<p>And then <code>sub1/__init__.py</code> looks like this:</p>

<pre><code>from .file1 import func1, func2
from .file2 import func3
</code></pre>

<p>The result is that I can do</p>

<pre><code>import package.sub1
package.sub1.func1()
</code></pre>

<p><strong>However</strong>, the problem is that the following does not work:</p>

<pre><code>&gt;&gt;&gt; import package.sub1
-- change things in file1.py --
&gt;&gt;&gt; reload(package.sub1)
</code></pre>

<p>The function does not update. It works if I do <code>import package.sub1.file1</code> instead, so there is something with flattening the namespace, that makes it lose the connection to the module. My main question is how I can still use the <code>reload</code> command, while still getting the benefits of being able to write sibling functions in separate files.</p>
