title: How would I implement a dict with Abstract Base Classes in Python?
body: <p>I attempted to implement a mapping in Python by using the abstract base class, MutableMapping, but I got an error on instantiation. How would I go about making a working version of this dictionary that would emulate the builtin <code>dict</code> class, in as many ways as possible, to be clear, with <strong>Abstract Base Classes</strong>?</p>
  
  <pre><code>&gt;&gt;&gt; class D(collections.MutableMapping):
  ...     pass
  ... 
  &gt;&gt;&gt; d = D()
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  TypeError: Can't instantiate abstract class D with abstract methods __delitem__, __getitem__, __iter__, __len__, __setitem__
  </code></pre>
  
  <p>A good answer will demonstrate how to make this work, specifically without subclassing <code>dict</code> (<a href="https://stackoverflow.com/questions/635483/what-is-the-best-way-to-implement-nested-dictionaries-in-python/19829714#19829714">a concept that I am quite familiar with</a>).</p>