4 ms·
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 nee
by dalke 12y ago
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.)
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()))