[issue2986] difflib.SequenceMatcher not matching long sequences

Terry J. Reedy report at bugs.python.org
Mon Jun 28 21:35:38 CEST 2010


Terry J. Reedy <tjreedy at udel.edu> added the comment:

The discussion on #152807 references two other closed tracker issues:
#1678339 Test case that currently fails
#1678345 Patch to change behavior - rejected because crippled behavior is supposedly intentional and removing the change would slow things down.

The patch simply removes the internal heuristic. I think a better patch would be to make it optional, with a tunable popularity threshold.

I say 'supposedly intentional' because the code comments only justify the popularity hack for code line comparison and give no indication of awareness that it disables SequenceMatcher for general purpose use, and in particular, for non-toy finite character set comparisons of the type (ascii) used in all the examples.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2986>
_______________________________________


More information about the Python-bugs-list mailing list