code: def compare(self, a, b):
          r
  
          cruncher = SequenceMatcher(self.linejunk, a, b)
          for tag, alo, ahi, blo, bhi in cruncher.get_opcodes():
              if tag == 'replace':
                  g = self._fancy_replace(a, alo, ahi, b, blo, bhi)
              elif tag == 'delete':
                  g = self._dump('-', a, alo, ahi)
              elif tag == 'insert':
                  g = self._dump('+', b, blo, bhi)
              elif tag == 'equal':
                  g = self._dump(' ', a, alo, ahi)
              else:
                  raise ValueError, 'unknown tag %r' % (tag,)
  
              for line in g:
                  yield line
docs: r"""
          Compare two sequences of lines; generate the resulting delta.
  
          Each sequence must contain individual single-line strings ending with
          newlines. Such sequences can be obtained from the `readlines()` method
          of file-like objects.  The delta generated also consists of newline-
          terminated strings, ready to be printed as-is via the writeline()
          method of a file-like object.
  
          Example:
  
          >>> print ''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(1),
          ...                                'ore\ntree\nemu\n'.splitlines(1))),
          - one
          ?  ^
          + ore
          ?  ^
          - two
          - three
          ?  -
          + tree
          + emu