MCPcopy Index your code
hub / github.com/RustPython/RustPython / set_seq2

Method set_seq2

Lib/difflib.py:222–248  ·  view source on GitHub ↗

Set the second sequence to be compared. The first sequence to be compared is not changed. >>> s = SequenceMatcher(None, "abcd", "bcde") >>> s.ratio() 0.75 >>> s.set_seq2("abcd") >>> s.ratio() 1.0 >>> SequenceMatcher computes

(self, b)

Source from the content-addressed store, hash-verified

220 self.matching_blocks = self.opcodes = None
221
222 def set_seq2(self, b):
223 """Set the second sequence to be compared.
224
225 The first sequence to be compared is not changed.
226
227 >>> s = SequenceMatcher(None, "abcd", "bcde")
228 >>> s.ratio()
229 0.75
230 >>> s.set_seq2("abcd")
231 >>> s.ratio()
232 1.0
233 >>>
234
235 SequenceMatcher computes and caches detailed information about the
236 second sequence, so if you want to compare one sequence S against
237 many sequences, use .set_seq2(S) once and call .set_seq1(x)
238 repeatedly for each of the other sequences.
239
240 See also set_seqs() and set_seq1().
241 """
242
243 if b is self.b:
244 return
245 self.b = b
246 self.matching_blocks = self.opcodes = None
247 self.fullbcount = None
248 self.__chain_b()
249
250 # For each element x in b, set b2j[x] to a list of the indices in
251 # b where x appears; the indices are in increasing order; note that

Callers 3

set_seqsMethod · 0.95
get_close_matchesFunction · 0.95
_fancy_replaceMethod · 0.95

Calls 1

__chain_bMethod · 0.95

Tested by

no test coverage detected