[Python-Dev] Side by Side Differencing Patch

Tim Peters tim.one at comcast.net
Wed Jun 9 23:43:24 EDT 2004

[Dan Gass]
> A while back I submitted a Python patch (#914575) for the difflib.py
> module and the diff.py utility script to add support for generating side
> by side differences. It was intended to be used for generating HTML pages
> but is generic where it can be used for other types of markup.

I wondered why you addressed this to me, and then I saw that someone
assigned your patch to me.  Sucks, doesn't it <0.5 wink>?  I'm sorry it sat
there ignored.  Sad fact is we have way more bug and patch reports than we
have volunteers to review them, and in the little time I can still make for
that I tend to focus on bug or bug+patch reports rather than new features.

That said, I downloaded the zip file attached to your patch just now, and
was delighted by the examples of its output you included.  I'd definitely
use this!  OTOH, I'm not an HTML Guy, and unassigned myself -- I'm not the
best person to review it.  I'm +1 on the concept, FWIW.

> 1) Is this worthwhile functionality where it would be worth including it
>    and supporting it in Python?

Yes, I think so.  The closest alternative I know of is the HTML-ized
diff'ing included in ViewCVS, which I believe also builds on difflib
functions.  I like your output better, both because of the embedded "next
difference" links and because of the intraline difference marking.

> 2) What can I do to help evolve it, prove its worth and get this patch on
>    the road for inclusion in Python?

I hope this exchange was enough to attract sufficient interest from another
potential reviewer.  If it isn't, add your comments to 10 other patches, and
Martin will feel honor-bound to do something for you <0.9 wink>.

> The patch was designed to not interfere or duplicate existing code (it
> uses the output of the ndiff iterator) and I believe is very maintainable
> code.  I initially wrote it for showing log differences in HTML test
> reports (personal project) but have also found it useful at work for
> supplementing Doxygen documentation with source differences and also a
> utility script which generates an HTML report of all the source
> differences between two builds.  In addition I've set up CVS to use it so
> that I have frequent exposure to the results of my algorithms to make
> sure I never see quirks.

Without a detailed review, I agree it looks like very high-quality work.

For purposes of getting the patch reviewed, it would help most if you:

a) Generated an ordinary context-diff patch against current CVS Python.


b) Added a documentation patch.  It doesn't need to be LaTeX -- if you
   write new docs in plain text, the reviewers here are usually happy
   to add the sometimes-mysterious markup needed to play well with
   the Python doc-generation tools.

More information about the Python-Dev mailing list