operators.distinct_until_changed
operators.distinct_until_changed
Section titled “operators.distinct_until_changed”Kind: function
Source: src/graphrefly/operators/_compare.py:70
Signature
Section titled “Signature”distinct_until_changed(g: Graph, src: Node[Any], equal: Equal | None = None, *, name: str | None = None, recipe: Recipe | None = None)Description
Section titled “Description”Send a DATA only when it differs from the last DATA sent, each in the array it came
in; the first passes (O-distinctUntilChanged). Two values are the same when
equal(last_sent, candidate) holds or, without equal, when they are ==
(graphrefly-py:D33): so 1, 1.0 and True are the same value, equal lists are the same
value, and a NaN is never the same as itself; give equal= for another reading. An
equality that raises, returns SENTINEL or returns what has no truth value ends the
operator with ERROR (D34).
Without equal it is always restorable; with one, when recipe builds it.
The behavior is the root’s operator contract: the operator contracts.