title: Why can't I create a default, ordered dict by inheriting OrderedDict and defaultdict?
body: <p>My first attempt to combine the features of two dictionaries in the <code>collections</code> module was to create a class that inherits them:</p>
  
  <pre><code>from collections import OrderedDict, defaultdict
  
  class DefaultOrderedDict(defaultdict, OrderedDict):
      def __init__(self, default_factory=None, *a, **kw):
          super().__init__(default_factory, *a, **kw)
  </code></pre>
  
  <p>However, I cannot assign an item to this dictionary:</p>
  
  <pre><code>d = DefaultOrderedDict(lambda: 0)
  d['a'] = 1
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/usr/lib64/python3.3/collections/__init__.py", line 64, in __setitem__
      self.__map[key] = link = Link()
  AttributeError: 'DefaultOrderedDict' object has no attribute '_OrderedDict__map'
  </code></pre>
  
  <p>Indeed, <a href="https://stackoverflow.com/q/6190331/1484957">this question about how to create a similar object</a> has answers that achieve it by extending the <code>OrderedDict</code> class and manually re-implementing the additional methods provided <code>defaultdict</code>. Using multiple inheritance would be cleaner. Why doesn't it work?</p>