Jun-15-2019, 08:50 PM
If lists are huge (thus memory can be a problem) and one doesn't need list but stream on unique values in order of appearance then generator can be option:
def uniquify(lst): seen = set() for item in lst: if item not in seen: yield item seen.add(item) for num in uniquify(numbers): # do_something
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.