Skip to content

Instantly share code, notes, and snippets.

@nathanhere
Created July 27, 2013 06:37
Show Gist options
  • Save nathanhere/6094010 to your computer and use it in GitHub Desktop.
Save nathanhere/6094010 to your computer and use it in GitHub Desktop.
Remove duplicates from a list
def removeListDuplicates(seq):
seen = set()
seen_add = seen.add
return [ x for x in seq if x not in seen and not seen_add(x) ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment