Following are two dicts.
In case I have
dict1 = {'mylist' : ['a', 'b', 'c', 'd']}
dict2 = {'mylist' : ['a', 'b', 'c', 'd']}
assert dict1.items() <= dict2.items() # PASS
and in case I have
dict1 = {'mylist' : ['a', 'b', 'c', 'd']}
dict2 = {'mylist' : ['d', 'c', 'b', 'a']}
assert dict1.items() <= dict2.items() # FAIL
I needed to sort both lists to be sure the comparison will pass.
I don't care about the items order.
Note that I need to compare dictionaries which only part of the keys values are list and part of them are of other types.
Is there a more straight forward method to compare the dicts and comparison to pass even if the list items are being ordered differently?
Python 3.7
Thanks