把含有字典的列表去重
from functools import reduce
def list_dict_removal(data_list):
run_function = lambda x, y: x if y in x else x + [y]
return reduce(run_function, [[], ] + data_list)
data_list = [{"a":1,"b":2,"c":"你好"},{"a":1,"b":2,"c":"你好"}]
print(list_dict_removal(data_list))

浙公网安备 33010602011771号