In Python difference in __dict__ between object() and class myClass(object)
<p>I was messing around with dynamic attributes and I noticed I could not use the __dict__ attribute if I created the object directly from the object() class but if I create a new class that is a direct descendent of object I can access the __dict__ attribute. Why the difference?</p>

<p>Examples:</p>

<blockquote>
<pre><code># This gives an AttributeError  
o = object()
o.__dict__
</code></pre>
</blockquote>

<pre><code># This works: prints {}
class myClass(object):
    pass
o = myClass()
o.__dict__
</code></pre>
