title: Inheritance rules in Python
body: <p>Usually, class inheritance means that all attributes and behavior of the base class are taken over to the derived class. So, if the derived class does not add any own attributes or behavior, instances of the base and of the derived class should be equal.</p>
  
  <p>In Python, this principle holds in most cases, but not in the following case:</p>
  
  <pre><code>&gt;&gt;&gt; class MyObject(object):
  ...     pass
  ... 
  &gt;&gt;&gt; [x for x in dir(MyObject()) if x not in dir(object())]
  ['__dict__', '__module__', '__weakref__']
  </code></pre>
  
  <p>Also weird:<br>
  <code>int</code> is derived from <code>object</code>, but instances of <code>int</code> have none of the attributes listed above.</p>
  
  <p>Why is there a break to the common inheritance rule?<br>
  And where I can find its documentation in the official Python docs?</p>