News for hackers. Stuff that matters.
Re:Dictdiffer: Diff and Patch Python dictionaries by jmmcd on Sunday May 26, 2013 @01:57PM (#5771848)
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://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.

There are no comments on this comment yet.