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

Method set_seq1

Lib/difflib.py:196–220  ·  view source on GitHub ↗

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

(self, a)

Source from the content-addressed store, hash-verified

194 self.set_seq2(b)
195
196 def set_seq1(self, a):
197 """Set the first sequence to be compared.
198
199 The second sequence to be compared is not changed.
200
201 >>> s = SequenceMatcher(None, "abcd", "bcde")
202 >>> s.ratio()
203 0.75
204 >>> s.set_seq1("bcde")
205 >>> s.ratio()
206 1.0
207 >>>
208
209 SequenceMatcher computes and caches detailed information about the
210 second sequence, so if you want to compare one sequence S against
211 many sequences, use .set_seq2(S) once and call .set_seq1(x)
212 repeatedly for each of the other sequences.
213
214 See also set_seqs() and set_seq2().
215 """
216
217 if a is self.a:
218 return
219 self.a = a
220 self.matching_blocks = self.opcodes = None
221
222 def set_seq2(self, b):
223 """Set the second sequence to be compared.

Callers 3

set_seqsMethod · 0.95
get_close_matchesFunction · 0.95
_fancy_replaceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected