def make_list_unique(sequence, marker_function=None):
 seen = {}
 result = []
 for item in sequence:
  marker = item
  if (marker_function is not None):
   marker = marker_function(item)
  if (marker in seen):
   continue
  seen[marker] = True
  result.append(item)
 return result

def make_list_unique ( sequence , marker_function = None ) : seen = { } result = [ ] for item in sequence : marker = item if ( marker_function is not None ) : marker = marker_function ( item ) if ( marker in seen ) : continue seen [ marker ] = True result . append ( item ) return result
makes items in a list unique performance based on this blog post: URL .