Files
dualfroz 1476898aa3 fix: only normalize values for hashing with operators that match
DeepHash._hash ran normalize_value_for_hashing of every registered custom
operator on every value, without ever consulting the operator's match method.
An operator scoped to one type therefore rewrote values of every other type.

When such an operator returns None for the values it was never meant to see,
all of those values hash to the same thing and unequal iterables compare as
equal under ignore_order=True: [1, 2] and [2, 3] were reported as identical.

Ask the operator whether it applies before normalizing. DeepHash walks a single
object at a time and has no t1/t2 pair, so the value is passed to match as both
sides via a small level-like view, which keeps operators scoped by type or by
path behaving as they do while diffing. Operators that define no match method
are still applied to everything.

Fixes #606
2026-09-03 14:17:11 +02:00
..