3 ms·
The list diff is really a set diff, if I understand it right, in that it disregards order and multiple instances? That should only happen if the dict member is
by jmmcd 13y ago
The list diff is really a set diff, if I understand it right, in that it disregards order and multiple instances? That should only happen if the dict member is a set. Members which are lists should be treated using a Levenshtein-distance style patch. For free you then get patching of string members.
I'm getting ambitious now, but what about tree-edit distance (with patch script) for members which are nested lists?
There is Python code out there for these:
https://github.com/timtadh/zhang-shasha https://github.com/timtadh/zhang-shasha
https://code.google.com/p/py-editdist https://code.google.com/p/py-editdist
EDIT I have only used the above libraries for distances, not for patchable diffs. But the Levenshtein and tree-edit distance algorithms are amenable to outputting the patch scripts.