Created
December 26, 2013 08:29
-
-
Save sdvcrx/8131270 to your computer and use it in GitHub Desktop.
去除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 uniqify_list(seq): | |
seen = Set() | |
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