title: How does Python 3.6 SequenceMatcher().get_matching_blocks() work?
body: <p>I am trying to use <code>SequenceMatcher.ratio()</code> to get the similarity of two strings: <code>"86418648"</code> and <code>"86488648"</code>:</p>
  
  <pre><code>&gt;&gt;&gt; SequenceMatcher(None,"86418648","86488648").ratio()
  0.5
  </code></pre>
  
  <p>The ratio returned is <code>0.5</code>, which is much lower than I expected because there is only one character different in the two strings.</p>
  
  <p>It seems that the ratio is calculated based on matching blocks. So I tried to run <code>SequenceMatcher.get_matching_blocks()</code>:</p>
  
  <pre><code>&gt;&gt;&gt; SequenceMatcher(None,"86418648","86488648").get_matching_blocks()
  [Match(a=4, b=0, size=4), Match(a=8, b=8, size=0)]
  </code></pre>
  
  <p>But I expected the result to be:</p>
  
  <pre><code>[Match(a=0, b=0, size=3), Match(a=4, b=4, size=4), Match(a=8, b=8, size=0)]
  </code></pre>
  
  <p>Can anyone help to explain why it didn't match from the first 3 numbers <code>"864"</code>?</p>