summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2014-08-04 05:40:59 (GMT)
committerRaymond Hettinger <python@rcn.com>2014-08-04 05:40:59 (GMT)
commitae39fbdd8456db5c5da57d7df7ca565026944c4a (patch)
tree3abd729483065f4237d5cf5245cb93b051b0661a /Lib
parentf25a38e5687df1c50cbc101c2528dbb81205e945 (diff)
downloadcpython-ae39fbdd8456db5c5da57d7df7ca565026944c4a.zip
cpython-ae39fbdd8456db5c5da57d7df7ca565026944c4a.tar.gz
cpython-ae39fbdd8456db5c5da57d7df7ca565026944c4a.tar.bz2
Make the import private to keep the global namespace clean.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/difflib.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/difflib.py b/Lib/difflib.py
index f161baa..9bc0d0d 100644
--- a/Lib/difflib.py
+++ b/Lib/difflib.py
@@ -30,7 +30,7 @@ __all__ = ['get_close_matches', 'ndiff', 'restore', 'SequenceMatcher',
'Differ','IS_CHARACTER_JUNK', 'IS_LINE_JUNK', 'context_diff',
'unified_diff', 'HtmlDiff', 'Match']
-import heapq
+from heapq import nlargest as _nlargest
from collections import namedtuple as _namedtuple
Match = _namedtuple('Match', 'a b size')
@@ -729,7 +729,7 @@ def get_close_matches(word, possibilities, n=3, cutoff=0.6):
result.append((s.ratio(), x))
# Move the best scorers to head of list
- result = heapq.nlargest(n, result)
+ result = _nlargest(n, result)
# Strip scores for the best n matches
return [x for score, x in result]