Message100203
Here is a patch against 2.6.4.
A brief description of how it works:
If we're emitting a "replace" with unequal lengths, then instead emit a replace followed by an insert or delete to make up for the difference in length.
My code to see that it works:
a = "aa bbb cc D"
b = "aa czbb cc E"
sm = difflib.SequenceMatcher(None, a, b).get_opcodes()
print "A = ", a
print "B = ", b
for o in opcodes:
tag, i1, i2, j1, j2 = o
print "%30r %-20s %-20s" % (o, a[i1:i2], b[j1:j2]) |
|
Date |
User |
Action |
Args |
2010-02-28 13:57:23 | Peter.Waller | set | recipients:
+ Peter.Waller, tim.peters, loewis, collinwinter, rhettinger, ggenellina, chipx86, tfaing |
2010-02-28 13:57:22 | Peter.Waller | set | messageid: <1267365442.92.0.454155632819.issue1711800@psf.upfronthosting.co.za> |
2010-02-28 13:57:21 | Peter.Waller | link | issue1711800 messages |
2010-02-28 13:57:20 | Peter.Waller | create | |
|