I want to return True of two lists of dictionaries are memberwise equal (member being the content of each dictionary, disregarding order of lists), else return False. What is good way to do that in python?
Eg, if a = [dict1, dict2] and b = [dict2, dict1], then a is equal to b. (dict1's and dict2's keys and values must match.)
Here's my way:
def _compare(self, a,b):
if len(a) != len(b):
return False
for d in a:
if d in b:
continue
else:
return False
return True