实例代码:
from functools import reduce rule_list = [1,2,3,43,2,1] remove_duplicate_func = lamba x,y : x if y in else x + [y] res = reduce(remove_duplicate_func, [[], ] + rule_list)