\end{tableii}
In addition to the above operations, both \class{Set} and \class{ImmutableSet}
-support set to set comparison operators based on the contents of their
-internal dictionaries. Two sets are equal if and only if every element of
-each set is contained in the other.
+support set to set equality comparisons. Two sets are equal if and only if
+every element of each set is contained in the other.
The following table lists operations available in \class{ImmutableSet}
but not found in \class{Set}:
"""
return self._data.iterkeys()
- # Comparisons. Ordering is determined by the ordering of the
- # underlying dicts (which is consistent though unpredictable).
-
- def __lt__(self, other):
- self._binary_sanity_check(other)
- return self._data < other._data
-
- def __le__(self, other):
- self._binary_sanity_check(other)
- return self._data <= other._data
+ # Equality comparisons using the underlying dicts
def __eq__(self, other):
self._binary_sanity_check(other)
self._binary_sanity_check(other)
return self._data != other._data
- def __gt__(self, other):
- self._binary_sanity_check(other)
- return self._data > other._data
-
- def __ge__(self, other):
- self._binary_sanity_check(other)
- return self._data >= other._data
-
# Copying operations
def copy(self):