nested_hash sorts set members and dictionary items, which raises TypeError for ordinary heterogeneous containers. For example, on Python 3.12 and current master:
from dictdiffer.utils import nested_hash
nested_hash({1, "one"})
nested_hash({1: ["one"], "two": {3, "three"}})
Both calls raise TypeError: '<' not supported between instances of 'str' and 'int'. These values are otherwise valid nested data, and this helper is also used by Unifier.
A regression should verify that both calls succeed and that changing dictionary insertion order does not change the resulting hash. I have a fix using order-independent hashing with regression tests; run-tests.sh passes locally.
nested_hashsorts set members and dictionary items, which raisesTypeErrorfor ordinary heterogeneous containers. For example, on Python 3.12 and current master:Both calls raise
TypeError: '<' not supported between instances of 'str' and 'int'. These values are otherwise valid nested data, and this helper is also used byUnifier.A regression should verify that both calls succeed and that changing dictionary insertion order does not change the resulting hash. I have a fix using order-independent hashing with regression tests;
run-tests.shpasses locally.