[issue1711800] SequenceMatcher bug with insert/delete block after replace
Peter Waller peter.wal...@gmail.com added the comment: Apologies for the bump, but it has been more than a year and I did attach a patch! :-) What next? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1711800 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1711800] SequenceMatcher bug with insert/delete block after replace
R. David Murray rdmur...@bitdance.com added the comment: No need to apologize for the bump. The trick is catching the interest of someone who feels qualified to judge the patch. I've added a couple people to nosy who worked on difflib recently. If no one speaks up in the next few days, it might be time to post to python-dev. -- nosy: +eli.bendersky, r.david.murray, terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1711800 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1711800] SequenceMatcher bug with insert/delete block after replace
Terry J. Reedy tjre...@udel.edu added the comment: I believe this issue should be closed and have set it to pending. The original report of a 'bug' and the two 'testcases' were and are invalid as they are based on an incorrect understanding of SequenceMatcher. It is not a diff program and in particular not a line diff program but the function used internally by such. It works on sequences of characters, lines, numbers, or anything else. Given the character strings 'abc' and 'abcd\def' it correctly reports that the second is a copy of 3 chars from the first plus insertion of 5 more. Gabriel correctly suggested the above in suggesting that if one wants to compare sequences of text lines, one might use Differ. One could also use SequenceMatcher directly, but this loses the diff-like formatting and report of within-line differences. I think this issue should have been closed then. I do not know what functionality Andrew thinks Christian was talking about. Using Differ with a = ['abc\n'] b = ['abcd\n', 'def\n'] for line in difflib.Differ().compare(a,b): print(line, end='') # prints - abc + abcd ?+ + def One line is replaced with two, with the extra info that the first new line is the old line with an extra char. I do not believe that 'any diffing program' will report the latter. The '?' lines are easily filtered out if not wanted. The patch by Peter has no motivation that I can see other than the idea that replacing a subsequence with one of a different length is somehow bad. Tim Peters did not think so and neither do I -- or Guido. Unequal replacement is built into the syntax of Python: s = [1,2,3] s[1:2] = [4,5,6] s [1, 4, 5, 6, 3] I would not be surprised it the proposed change broke some existing application or degraded performance a bit. -- assignee: tim_one - resolution: - invalid status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1711800 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1711800] SequenceMatcher bug with insert/delete block after replace
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1711800 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1711800] SequenceMatcher bug with insert/delete block after replace
Martin v. Löwis [EMAIL PROTECTED] added the comment: Without a patch, this is not a candidate for 2.5.3. -- nosy: +loewis versions: +Python 2.7 -Python 2.5.3 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1711800 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1711800] SequenceMatcher bug with insert/delete block after replace
Raymond Hettinger [EMAIL PROTECTED] added the comment: Tim, any comments or interest? -- assignee: - tim_one nosy: +rhettinger, tim_one ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1711800 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1711800] SequenceMatcher bug with insert/delete block after replace
Andrew Inglis [EMAIL PROTECTED] added the comment: Are there any updates for this issue? I am having the same problem, or, lack of feature, with SequenceMatcher. Gabriel, Differ doesn't seem to have the functionality, or an easy way to patch it to get the functionality, that Christian is talking about. Christian, what are these Any diffing program[s] that you speak of that give the same output of SequenceMatcher with this issue fixed? Any solutions you found for python? Thanks! -- nosy: +tfaing type: - feature request versions: +Python 2.5.3 -Python 2.6 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1711800 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com