[Patches] [ python-Patches-600984 ] Refactoring of difflib.Differ

SourceForge.net noreply@sourceforge.net
Fri, 11 Apr 2003 18:30:07 -0700


Patches item #600984, was opened at 2002-08-27 16:54
Message generated for change (Comment added) made by nnorwitz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=600984&group_id=5470

Category: Library (Lib)
Group: Python 2.1.2
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Costas Malamas (cmalamas)
Assigned to: Tim Peters (tim_one)
Summary: Refactoring of difflib.Differ 

Initial Comment:
The difflib.Differ class currently only acts as a helper for 
ndiff, creating human-readable diffs that mimic the Unix 
diff.  This patch refactors Differ into two layers: 
BaseDiffer and Differ.  

BaseDiffer contains the workhorse algorithms of the 
current Differ without format-specific code.  Instead, it 
adds event handlers that are triggered as the diff is 
calculated.  Thus the Differ engine can now be used to 
produce diff reports in other formats (like HTML or XML) 
or to add programmatic behavior --for example to extract 
only inserted XML from an XML feed for faster parsing.

Differ implements the BaseDiffer API to produce a 
backwards-compatible diff, just like ndiff.


----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2003-04-11 21:30

Message:
Logged In: YES 
user_id=33168

Costas, since this patch would only be applied against 2.3,
the current patch is not useful.  If you are interested in
forward porting the patch to current code, we can consider
it then.  Thanks.

----------------------------------------------------------------------

Comment By: Costas Malamas (cmalamas)
Date: 2002-08-27 16:59

Message:
Logged In: YES 
user_id=71233

Forgot to say that this is a 2.1 patch only as I cannot test 2.2 
yet.  Assigned to Tim, since it's 95% his code.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=600984&group_id=5470