2 ms·
Correct. But the idea is probably that the dicts in the frozendicts themselves should be frozendicts.
by bjourne 12y ago
Correct. But the idea is probably that the dicts in the frozendicts themselves should be frozendicts.
- dalke 12y agoCertainly. 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.) I personally think the use case is better handled with the unique_everseen in https://docs.python.org/2/library/itertools.html https://docs.python.org/2/library/itertools.html : uniq_res = unique_everseen(res, lambda d: sorted(d.items()))