Skip to content

Instantly share code, notes, and snippets.

@adambene
Last active July 2, 2020 23:37
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/1acafcfa490e236b3160d610102ebc54 to your computer and use it in GitHub Desktop.
Save adambene/1acafcfa490e236b3160d610102ebc54 to your computer and use it in GitHub Desktop.
import sys
def distinct_preserve_order_py37(items):
assert sys.version_info >= (3, 7), 'Please use Python 3.7 or above for this code.'
return list(dict().fromkeys(items).keys())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment