On 7 February 2013 11:46, Michael Hanselmann <[email protected]> wrote:
> 2013/2/7 Bernardo Dal Seno <[email protected]>:
>> On 7 February 2013 09:01, Iustin Pop <[email protected]> wrote:
>>> I'm not sure I like the deepcopy there… since we don't care about the
>>> actual contents, only if it's different, what about serialising it back
>>> as Michael said? Then you don't need to keep an intermediate
>>> representation in memory, just serialise it back and compare with
>>> raw_data, which is still available.
>>
>> The problem with serialization is that there is no guarantee the
>> dictionaries are serialized in a stable way. So I didn't choose that
>> way.
>
> You don't need to serialize to a string, but only to a dict
> (….ToDict()). That way you can easily compare them.

If you remove deepcopy and leave only ToDict(), unit tests would fail
(that was my first idea).

Bernardo

Reply via email to