Make the import private to keep the global namespace clean.
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 @@
'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 @@
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]