(list_, key=lambda x: x)
return result
efficient function to uniquify a list preserving item order
efficient function to uniquify a list preserving item order
efficient function to uniquify a list preserving item order
def unique(list_, key=lambda x: x):
    """efficient function to uniquify a list preserving item order"""
    seen = set()
    result = []
    for item in list_:
        seenkey = key(item)
        if seenkey in seen:
            continue
        seen.add(seenkey)
        result.append(item)
    return result
def unique ( list_ , key = lambda x : x ) : seen = set ( ) result = [ ] for item in list_ : seenkey = key ( item ) if seenkey in seen : continue seen . add ( seenkey ) result . append ( item ) return result