summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-07-31 08:00:13 (GMT)
committerGeorg Brandl <georg@python.org>2010-07-31 08:00:13 (GMT)
commit6cb047b21c841450c1178720a1af5bebbbdbf21a (patch)
tree0030b6ade0090ffe630449b16084ce061bb4ed2d
parentf417ae8d4c9bb497868124098aeb2c260dd1964c (diff)
downloadcpython-6cb047b21c841450c1178720a1af5bebbbdbf21a.zip
cpython-6cb047b21c841450c1178720a1af5bebbbdbf21a.tar.gz
cpython-6cb047b21c841450c1178720a1af5bebbbdbf21a.tar.bz2
#2986: document SequenceMatcher heuristic.
-rw-r--r--Doc/library/difflib.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst
index d749e14..9cd76e3 100644
--- a/Doc/library/difflib.rst
+++ b/Doc/library/difflib.rst
@@ -37,6 +37,11 @@ diffs. For comparing directories and files, see also, the :mod:`filecmp` module.
complicated way on how many elements the sequences have in common; best case
time is linear.
+ **Heuristic:** To speed-up matching, items that appear more than 1% of the
+ time in sequences of at least 200 items are treated as junk. This has the
+ unfortunate side-effect of giving bad results for sequences constructed from
+ a small set of items. An option to turn off the heuristic will be added to a
+ future version.
.. class:: Differ