my_list = [{'a': 1, 'b': 2}, {'a': 1, 'b': 2}]
要求去除列表里的重复元素, 并且不改变列表原有元素的顺序
new_list = [dict(i) for i in {}.fromkeys([frozenset(j.items()) for j in my_list])]
In [1]: my_list = [{'a': 1, 'b': 2}, {'a': 1, 'b': 2}]
In [2]: new_list = [dict(i) for i in {}.fromkeys([frozenset(j.items()) for j in my_list])]
In [3]: new_list
Out[3]: [{'b': 2, 'a': 1}]