I have a similar question to this question: Determine if 2 lists have the same elements, regardless of order?
What is the best/quickest way to determine whether an unsor
Use sets
def doSomething(myDictOfLists, otherInputs):
list1 = []
... # do something here with `otherInputs'
... # which gives `list1' some values
# now only append `list1' to `myListOfLists' if it doesn't already exist
# and if it does exist, remove it
list1Set = set(list1)
if list1Set not in myDictOfLists:
myDictOfLists[list1Set] = list1
return myDictOfLists