I need to check the presence of a list in list of lists. The problem that i face is that my list is composed of class objects and therefore i am not able to do this using the normal
"if list in list_of_lists" method

the relevant part of my code is as follows

for ind in feasible_pop_comp:
for other in feasible_pop_comp:
if ind.Type!= other.Type:
comp=[ind,other]
if comp not in self.candidate.list #does not work even with .any() or .all() included
dombool=self.compare_typematch(ind, other)
if (dombool==0):
replace=self.check_distance(ind.point,other.point)
if replace:
if(ind<other):
feasible_pop_comp.remove(other)
else:
feasible_pop_comp.remove(ind)
else:
self.candidate_list.append(comp)

"My class already has inbuilt commands to check structural similarities with other class objects" <- have you written an __eq__ method in your class? If so, you can go ahead with the'the normal "if list in list_of_lists" method'
–
inspectorG4dgetFeb 10 '12 at 16:47