Skip to content

Instantly share code, notes, and snippets.

@adambene
Last active July 2, 2020 22:50
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 adambene/0098ed14b8662cd4767c35138391cafe to your computer and use it in GitHub Desktop.
Save adambene/0098ed14b8662cd4767c35138391cafe to your computer and use it in GitHub Desktop.
def distinct_set_constr(items):
# The constructor of the set iterates through the item list in linear O(n) time:
# https://github.com/python/cpython/blob/3.9/Objects/setobject.c#L902-L909
return list(set(items))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment