def dictDiffAndReport(da, db):
 differences = dictDiff(da, db)
 if (not differences):
  return differences
 if differences['inAButNotInB']:
  print ('>>> inAButNotInB: %s' % differences['inAButNotInB'])
 if differences['inBButNotInA']:
  print ('>>> inBButNotInA: %s' % differences['inBButNotInA'])
 for key in differences['differentValues']:
  print ('>>> da[%s] != db[%s]' % (key, key))
  print ('da[%s] = %r' % (key, da[key]))
  print ('db[%s] = %r' % (key, db[key]))
 return differences

def dictDiffAndReport ( da , db ) : differences = dictDiff ( da , db ) if ( not differences ) : return differences if differences [ 'inAButNotInB' ] : print ( '>>> inAButNotInB: %s' % differences [ 'inAButNotInB' ] ) if differences [ 'inBButNotInA' ] : print ( '>>> inBButNotInA: %s' % differences [ 'inBButNotInA' ] ) for key in differences [ 'differentValues' ] : print ( '>>> da[%s] != db[%s]' % ( key , key ) ) print ( 'da[%s] = %r' % ( key , da [ key ] ) ) print ( 'db[%s] = %r' % ( key , db [ key ] ) ) return differences
compares two python dictionaries at the top level and report differences .