I've created a dictionary like
d = {1: {"a":1, "b":2}, 2: {"a":1, "b":2}}
I'm looping through objects to create dictionaries like the above.
I also want to create a reverse of the above dictionary while I loop, it should look like
d2 = {{"a":1, "b":2}: 1, {"a":1, "b":2}: 2}
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.
Is there some way to do this in python?