I'm walking a data structure and would like to build a dict mapping X->Y, where X is a field in the data structure I'm walking and Y is a field in the data structure I'm building on the fly. X is an unhashable type.
Trivially:
idmap = {}
idmap[id(x)] = y
Use the id
of x
as the dictionary key