need_check_goods_list=[{ 'id': '1', 'iname': '1' },{ 'id': '2', 'iname': '2' },{ 'id': '3', 'iname': '32' },{ 'id': '3', 'iname': '33' }] # 使用字典去重 unique_goods_dict = {item['id']: item for item in need_check_goods_list} # 将字典转换回列表 need_check_goods_list = list(unique_goods_dict.values()) print(need_check_goods_list)