python字典形list 去重复

  data_list = [{"a": "123", "b": "321"}, {"a": "123", "b": "321"}, {"b": "321", "a": "123"}]
    run_function = lambda x, y: x if y in x else x + [y]
    return reduce(run_function, [[], ] + data_list)

 

posted @ 2019-03-08 01:02  AngDH  阅读(239)  评论(0编辑  收藏  举报