That is, hash of the 'extra' value will fail, because dictionaries are unhashable, therefore a frozendict of the above can't have a good hash.
I say "good hash" because it's possible to define a dictionary hash based only on the keys, but in this use case all of the entries have the same keys, so are in the same position in the hash table, causing frozendict operations to switch from amortized O(1) to O(n) operations.
Certainly. The question is really who is in charge of carrying out the "should". Currently it's the programmer, who needs to write an adapater. That adapter needs to know to convert any mutable values (dict, list, set, etc) to immutable form (frozendict, tuple, frozenset, etc.)
The use case is to get the unique dictionaries from a list of dictiories
Won't that fail if the res[] elements themselves happen to contain dictionaries, as in: That is, hash of the 'extra' value will fail, because dictionaries are unhashable, therefore a frozendict of the above can't have a good hash.I say "good hash" because it's possible to define a dictionary hash based only on the keys, but in this use case all of the entries have the same keys, so are in the same position in the hash table, causing frozendict operations to switch from amortized O(1) to O(n) operations.