title: Python dict update from my custom dict not using my overridden methods
body: <p>I have a custom implementation of dict <code>custom_dict</code>, which overrides and is by-and-large supported by the native Python dict.</p>
  <ul>
  <li>I override setting (<code>__setitem__</code>) to do some preprocessing to the value, and store it in some proprietary object.</li>
  <li>When getting(<code>__getitem__</code>), this proprietary object is then converted to a more natural format.</li>
  </ul>
  <p>All features when invoked from this <code>custom_dict</code> behave as I like.</p>
  <p>The problem is that when you call something like <code>{'a': 1}.update(custom_dict({'b': 2}))</code>, the value for 'b' in the updated dict is the proprietary internal storage object, and not the processed value.</p>
  <p>How does Python's native <code>dict.update()</code> work? I've overridden all the methods I could think of it using, <code>items</code>, <code>iteritems</code>, <code>values</code>, <code>itervalues</code>, <code>get</code>, and <code>__getitem__</code>, but I haven't seemed to nail any of the ones <code>update()</code> tries to access, which leads me to believe it might be using the c code.  Thoughts?</p>
  <p>UPDATE: I just found this in the CPython source code:</p>
  <pre><code>if (PyDict_Check(b)) {
      ...
  }
  else {
      /* Do it the generic, slower way */
      ...
  }
  </code></pre>
  <p>Perhaps this is a bug, and that should be <code>PyDict_CheckExact(b)</code> as shows up in various other places in the code.</p>
  <p>Any idea how to beat this check?</p>