def hashable(a):
 if isinstance(a, dict):
  return hashable(a.items())
 try:
  return tuple(map(hashable, a))
 except:
  return a

def hashable ( a ) : if isinstance ( a , dict ) : return hashable ( a . items ( ) ) try : return tuple ( map ( hashable , a ) ) except : return a
turn some unhashable objects into hashable ones .