⬅︎ Back to Fastest way to uniqify a list in Python
This seems to work on any list, including one of lists or tuples:[[elem,already.append(elem)][0] for elem in thisList if elem not in already]Now, I'm not sure if it's bad practise to call a function in there sneakily like that, but it works ;).
f1 apparently doesn't work on lists of tuples. It would be nice to have a generalized version. [(0, 1), (1, 2), (3, 2), (2, 1), (2, 0), (2, 3), (1, 0), (0, 2)]
Comment
This seems to work on any list, including one of lists or tuples:
[[elem,already.append(elem)][0] for elem in thisList if elem not in already]
Now, I'm not sure if it's bad practise to call a function in there sneakily like that, but it works ;).
Parent comment
f1 apparently doesn't work on lists of tuples. It would be nice to have a generalized version. [(0, 1), (1, 2), (3, 2), (2, 1), (2, 0), (2, 3), (1, 0), (0, 2)]