Consider this code:
a = {...} # a is an dict with arbitrary contents
b = a.copy()
Dicts are unordered sets of key:value pairs. The keys must be immutable, and therefore hashable. To determine if an object is hashable, you can use the hash() function:
>>> hash(1)
1
>>> hash('a')
12416037344
>>> hash([1,2,3])
Traceback (most recent call last):
File "", line 1, in
TypeError: unhashable type: 'list'
>>> hash((1,2,3))
2528502973977326415
>>> hash({1: 1})
Traceback (most recent call last):
File "", line 1, in
TypeError: unhashable type: 'dict'
The values, on the other hand, can be any object. If you need to check if an object is immutable, then I would use hash().