title: Determine where documents differ with Python
body: <p>I have been using the Python <a href="http://docs.python.org/library/difflib.html" rel="nofollow noreferrer">difflib</a> library to find where 2 documents differ. The Differ().compare() method does this, but it is <strong>very</strong> slow - atleast 100x slower for large HTML documents compared to the <a href="http://www.computerhope.com/unix/udiff.htm" rel="nofollow noreferrer">diff</a> command.</p>
  
  <p>How can I efficiently determine where 2 documents differ in Python? (Ideally I am after the positions rather the actual text, which is what SequenceMatcher().get_opcodes() returns.)</p>