Skip to content

Instantly share code, notes, and snippets.

@sdvcrx
Created December 26, 2013 08:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sdvcrx/8131270 to your computer and use it in GitHub Desktop.
Save sdvcrx/8131270 to your computer and use it in GitHub Desktop.
去除list中相同项的最快的方法
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