def compare_parser_results(left, right):
 def to_los(obj):
  'Generate a list of strings representation of object.'
  if (type(obj) is list):
   return [('%d) %s' % pair) for pair in itertools.izip(itertools.count(), obj)]
  else:
   return [('i) %s' % obj)]
 return difflib.Differ().compare(to_los(left), to_los(right))

def compare_parser_results ( left , right ) : def to_los ( obj ) : if ( type ( obj ) is list ) : return [ ( '%d) %s' % pair ) for pair in itertools . izip ( itertools . count ( ) , obj ) ] else : return [ ( 'i) %s' % obj ) ] return difflib . Differ ( ) . compare ( to_los ( left ) , to_los ( right ) )
generates a textual report on the differences between .