Created
July 27, 2013 06:37
-
-
Save nathanhere/6094010 to your computer and use it in GitHub Desktop.
Remove duplicates from a list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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