Python: Determine if an unsorted list is contained in a 'list of lists', regardless of the order to the elements
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 unsorted list list1 is contained in a 'list of lists' myListOfLists , regardless of the order to the elements in list1 ? My attempt is wrapped up in the function doSomething(...) which I call many times: def doSomething(myListOfLists, 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