Loop until steady-state of a complex data structure in Python
<p>I have a more-or-less complex data structure (list of dictionaries of sets) on which I perform a bunch of operations in a loop until the data structure reaches a steady-state, ie. doesn't change anymore. The number of iterations it takes to perform the calculation varies wildly depending on the input.</p>

<p>I'd like to know if there's an established way for forming a halting condition in this case. The best I could come up with is pickling the data structure, storing its md5 and checking if it has changed from the previous iteration. Since this is more expensive than my operations I only do this every 20 iterations but still, it feels wrong.</p>

<p>Is there a nicer or cheaper way to check for deep equality so that I know when to halt?</p>

<p>Thanks!</p>
