Skip to content

Instantly share code, notes, and snippets.

Created March 28, 2017 23:40
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 anonymous/d7c9421eb54e94a8cfaf1a513fcf3c63 to your computer and use it in GitHub Desktop.
Save anonymous/d7c9421eb54e94a8cfaf1a513fcf3c63 to your computer and use it in GitHub Desktop.
def extract_unique_elements(a_list):
if isinstance(a_list, list) == False:
return {a_list}
uniq = set()
for element in a_list:
uniq.union(extract_unique_elements(element))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment