Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f1da628

Browse files
committed
Fix a few small typos in the docstrings.
get_close_matches(): Do not use %-interpolation for strings when concatenation is more efficient.
1 parent f6a9617 commit f1da628

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Lib/difflib.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
Optional arg isjunk is None (the default), or a one-argument function
105105
that takes a sequence element and returns true iff the element is junk.
106106
None is equivalent to passing "lambda x: 0", i.e. no elements are
107-
considered to be junk. For examples, pass
107+
considered to be junk. For example, pass
108108
lambda x: x in " \\t"
109109
if you're comparing lines as sequences of characters, and don't want to
110110
synch up on blanks or hard tabs.
@@ -289,7 +289,7 @@ def __init__(self, isjunk=None, a='', b=''):
289289
Optional arg isjunk is None (the default), or a one-argument
290290
function that takes a sequence element and returns true iff the
291291
element is junk. None is equivalent to passing "lambda x: 0", i.e.
292-
no elements are considered to be junk. For examples, pass
292+
no elements are considered to be junk. For example, pass
293293
lambda x: x in " \\t"
294294
if you're comparing lines as sequences of characters, and don't
295295
want to synch up on blanks or hard tabs.
@@ -299,7 +299,7 @@ def __init__(self, isjunk=None, a='', b=''):
299299
also .set_seqs() and .set_seq1().
300300
301301
Optional arg b is the second of two sequences to be compared. By
302-
default, an empty string. The elements of a must be hashable. See
302+
default, an empty string. The elements of b must be hashable. See
303303
also .set_seqs() and .set_seq2().
304304
"""
305305

@@ -752,9 +752,9 @@ def get_close_matches(word, possibilities, n=3, cutoff=0.6):
752752
"""
753753

754754
if not n > 0:
755-
raise ValueError("n must be > 0: %s" % `n`)
755+
raise ValueError("n must be > 0: " + `n`)
756756
if not 0.0 <= cutoff <= 1.0:
757-
raise ValueError("cutoff must be in [0.0, 1.0]: %s" % `cutoff`)
757+
raise ValueError("cutoff must be in [0.0, 1.0]: " + `cutoff`)
758758
result = []
759759
s = SequenceMatcher()
760760
s.set_seq2(word)

0 commit comments

Comments
 (0)