谢谢大家!
我试图实现它,如下所示:
def uniq(list): u = [] d = [u.append(e) for e in list if e not in u] return u
虽然它按预期工作,但在某种意义上它可能是一种糟糕的代码实践(我是Python的新手)。