mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
parent
ecfeb7f095
commit
70a6b49821
246 changed files with 926 additions and 962 deletions
|
@ -689,9 +689,9 @@ def get_close_matches(word, possibilities, n=3, cutoff=0.6):
|
|||
"""
|
||||
|
||||
if not n > 0:
|
||||
raise ValueError("n must be > 0: " + `n`)
|
||||
raise ValueError("n must be > 0: %r" % (n,))
|
||||
if not 0.0 <= cutoff <= 1.0:
|
||||
raise ValueError("cutoff must be in [0.0, 1.0]: " + `cutoff`)
|
||||
raise ValueError("cutoff must be in [0.0, 1.0]: %r" % (cutoff,))
|
||||
result = []
|
||||
s = SequenceMatcher()
|
||||
s.set_seq2(word)
|
||||
|
@ -876,7 +876,7 @@ class Differ:
|
|||
elif tag == 'equal':
|
||||
g = self._dump(' ', a, alo, ahi)
|
||||
else:
|
||||
raise ValueError, 'unknown tag ' + `tag`
|
||||
raise ValueError, 'unknown tag %r' % (tag,)
|
||||
|
||||
for line in g:
|
||||
yield line
|
||||
|
@ -988,7 +988,7 @@ class Differ:
|
|||
atags += ' ' * la
|
||||
btags += ' ' * lb
|
||||
else:
|
||||
raise ValueError, 'unknown tag ' + `tag`
|
||||
raise ValueError, 'unknown tag %r' % (tag,)
|
||||
for line in self._qformat(aelt, belt, atags, btags):
|
||||
yield line
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue