(seq, idfun=None)
return result
Efficient method to remove dupes from list, while preserving order.
Efficient method to remove dupes from list, while preserving order.
Efficient method to remove dupes from list while preserving order .
def remove_dupes(seq, idfun=None):
    """
        Efficient method to remove dupes from list, while preserving order.
    """
    if idfun is None:
        def idfun(x):
            return x
    seen = {}
    result = []
    for item in seq:
        marker = idfun(item)
        if marker in seen:
            continue
        seen[marker] = 1
        result.append(item)
    return result
def remove_dupes ( seq , idfun = None ) : if idfun is None : def idfun ( x ) : return x seen = { } result = [ ] for item in seq : marker = idfun ( item ) if marker in seen : continue seen [ marker ] = 1 result . append ( item ) return result