def unique_everseen ( seq ) : seen = set ( ) seen_add = seen . add return [ x for x in seq if not ( x in seen or seen_add ( x ) ) ]
python set of lists mutable
Solution found here : http : // stackoverflow . com / questions / 480214 / how - do - you - remove - duplicates - from - a - list - in - python - whilst - preserving - order
def unique_everseen(seq):
    """Solution found here : http://stackoverflow.com/questions/480214/how-do-you-remove-duplicates-from-a-list-in-python-whilst-preserving-order"""
    seen = set()
    seen_add = seen.add
    return [x for x in seq if not (x in seen or seen_add(x))]