How do a get a clean import namespace for a package in python?
<p>I'm sure this is trivial to do, but I can't figure it out.</p>

<p>Directory structure:</p>

<pre><code>mylib/__init__.py
mylib/MyClass.py
</code></pre>

<p><strong>init</strong>.py reads:</p>

<pre><code>import MyClass
__all__ = [MyClass]
</code></pre>

<p>MyClass.py:</p>

<pre><code>class MyClass(object): 
    def __init__(self):
        pass
</code></pre>

<p>I have to create instances of MyClass using mylib.MyClass.MyClass(), when I want it to be mylib.MyClass()</p>

<p>I thought that to get this to work I have to put <strong>all</strong> = [MyClass.MyClass], but that didn't work.</p>

<p>How do you get this to work?</p>

<p>NB. I understand what is happening here; the file itself is a namespace and you could for example say, have multiple classes in a single file. However, I only have one class in each .py file, so I don't want that level of detail. </p>

<p>ie. 
I have this:</p>

<pre><code>&gt;&gt;&gt; import mylib
&gt;&gt;&gt; tmp = mylib.MyClass.MyClass()
</code></pre>

<p>I want this:</p>

<pre><code>&gt;&gt;&gt; import mylib
&gt;&gt;&gt; tmp = mylib.MyClass()
</code></pre>
