def __eq__ ( self , anotherset ) : if not isinstance ( anotherset , LR0ItemSet ) : raise TypeError if len ( self . itemlist ) != len ( anotherset . itemlist ) : return False for element in self . itemlist : if element not in anotherset . itemlist : return False return True
in python how to check if 3 sets are equal
Tests on itemlist equality
def __eq__(self, anotherset):
        """Tests on itemlist equality"""
        if not isinstance(anotherset, LR0ItemSet):
            raise TypeError
        if len(self.itemlist) != len(anotherset.itemlist):
            return False
        for element in self.itemlist:
            if element not in anotherset.itemlist:
                return False
        return True