Classes Inside Modules
<p>Lets say I have the code:</p>

<pre><code>class NoneDict(dict):
    def __getitem__(self, name):
        try:
                return super(NoneDict, self).__getitem__(name)
        except:
                return None
</code></pre>

<p>I want people to be able to create a NoneDict object without writing all this code out. I tried including it in a module and then typed:</p>

<pre><code>import nonedict
foo = NoneDict()
</code></pre>

<p>But it didn't work. How can I make it so someone can import the module and then be able to create a nonedict without typing out all the code?</p>
