When I read this my first thought was "you should use a FrozenDict", but looking into it, it seems that it doesn't exist; I assumed so because of FrozenSets (hashable sets).
You can still create a hashable key from a dict with FrozenSet(mydict.items()).