title: Difflib Sequence Matcher Algorithm
body: <p>SequenceMatcher is a class available in python module named 'difflib.' It can be used for comparing pairs of input sequences. I'm writing a research paper for which I need the steps of the actual algorithm being used for this class. According to the official documentation:</p>
  <p><em>SequenceMatcher is a flexible class for comparing pairs of sequences of any type, so long as the sequence elements are hashable. The basic algorithm predates, and is a little fancier than, an algorithm published in the late 1980's by Ratcliff and Obershelp under the hyperbolic name &quot;gestalt pattern matching&quot;.</em></p>
  <p>Source: <a href="https://github.com/python/cpython/blob/main/Lib/difflib.py" rel="nofollow noreferrer">https://github.com/python/cpython/blob/main/Lib/difflib.py</a></p>
  <p>This states that the basic algoritm is somehow similar to the algorithm called <em>'gestalt pattern matching'</em> but the documentation fails to specify what the actual algorithm used here is. I need help trying to figure out what that actual algorithm is!</p>