def __eq__(self, other):
        """Returns 1 if the sets are equal."""
        if len(self.elems) != len(other.elems):
            return 0
        else:
            return len(self - other) == 0
Returns 1 if the sets are equal.
recipes/Python/106469_Yet_another_Set_class_for_Python/recipe-106469.py