Carreau / difflib2.py

An surpriseless alternative to difflib
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

Equivalent of stdlib's get_opcodes()? #1

Open mpenning opened 9 years ago

mpenning commented 9 years ago

Hi,

I have a library which uses SequenceMatcher.get_opcodes() to identify a set of diffs between lists of text objects.

I'm interested in testing difflib2; however, I'm curious whether there is a way to mimic the behavior of SequenceMatcher.get_opcodes() so I could drop it into my library and leverage the existing test suite? If you'd like to see how I'm using difflib, check out ciscoconfparse.py. Right now, I build a heirarchy of parent objects and root each diff from the parent object, since it tends to get better results from difflib.

Thoughts?

Carreau commented 9 years ago

Hi,

Difflib2 is mostly a playground, I haven't especially worked on it in a while, mostly for lack of time. IIRC, I should have an IPython notebook lying around that try to replicate the Sequece matcher API. I'll try to find it. But I'm not sure I went so far as to do get_opcodes()