summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorTerry Reedy <tjreedy@udel.edu>2010-12-03 18:57:42 (GMT)
committerTerry Reedy <tjreedy@udel.edu>2010-12-03 18:57:42 (GMT)
commit74a7c67db15d617a09d71d5c368ddded72f0362d (patch)
treeadafd2bef5e0c23910ecdb3804d4e488892ba973 /Lib
parentf3b68b3f981b8baa81e3e838ab921d2e4362ae33 (diff)
downloadcpython-74a7c67db15d617a09d71d5c368ddded72f0362d.zip
cpython-74a7c67db15d617a09d71d5c368ddded72f0362d.tar.gz
cpython-74a7c67db15d617a09d71d5c368ddded72f0362d.tar.bz2
Diffstat (limited to 'Lib')
-rw-r--r--Lib/difflib.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/difflib.py b/Lib/difflib.py
index fa8c287..e31259a 100644
--- a/Lib/difflib.py
+++ b/Lib/difflib.py
@@ -213,6 +213,10 @@ class SequenceMatcher:
# (at least 200 elements) and x accounts for more than 1 + 1% of
# its elements (when autojunk is enabled).
# DOES NOT WORK for x in a!
+ # bjunk
+ # the items in b for which isjunk is True.
+ # bpopular
+ # nonjunk items in b treated as junk by the heuristic (if used).
self.isjunk = isjunk
self.a = self.b = None
@@ -321,7 +325,7 @@ class SequenceMatcher:
indices.append(i)
# Purge junk elements
- junk = set()
+ self.bjunk = junk = set()
isjunk = self.isjunk
if isjunk:
for elt in list(b2j.keys()): # using list() since b2j is modified
@@ -330,7 +334,7 @@ class SequenceMatcher:
del b2j[elt]
# Purge popular elements that are not junk
- popular = set()
+ self.bpopular = popular = set()
n = len(b)
if self.autojunk and n >= 200:
ntest = n // 100 + 1