⬅︎ Back to Fastest way to uniqify a list in Python
I use this function on a script that needs to work on both version 2.3 and higher versions(and doesn't care about preserving order).def unique(seq): try: return list(set(seq)) except NameError: return {}.fromkeys(seq).keys()
Comment
I use this function on a script that needs to work on both version 2.3 and higher versions(and doesn't care about preserving order).
def unique(seq):
try:
return list(set(seq))
except NameError:
return {}.fromkeys(seq).keys()