Python reversed mapping / dictionary with unhashable type?
<p>I've created a dictionary like</p>

<pre><code>d = {1: {"a":1, "b":2}, 2: {"a":1, "b":2}}
</code></pre>

<p>I'm looping through objects to create dictionaries like the above.</p>

<p>I also want to create a reverse of the above dictionary while I loop, it should look like</p>

<pre><code>d2 = {{"a":1, "b":2}: 1, {"a":1, "b":2}: 2}
</code></pre>

<p>I know that the dictionary is an unhashable type, but at the same time I want the ability to reverse look up values without looping through the dictionary.</p>

<p>Is there some way to do this in python?</p>
