示例#1
0
 def isdisjoint(self, other):
     """
     Checks whether there are no common items in this set and other.
     
     :type other: iterable
     
     Examples:
     >>> assert FrozenSortedSet([1, 3, 2]).isdisjoint([42])
     """
     
     return FrozenSetTree._ext_cmp(self, other, 3)
示例#2
0
    def isdisjoint(self, other):
        """
        Checks whether there are no common items in this set and other.
        
        :type other: iterable
        
        Examples:
        >>> assert FrozenSortedSet([1, 3, 2]).isdisjoint([42])
        """

        return FrozenSetTree._ext_cmp(self, other, 3)
示例#3
0
 def __eq__(self, other):
     """
     :param other: A sequence of items.
     :type other: iterable
     :returns: Whether this set is equal to the set of other.
     
     Examples:
     
     >>> assert FrozenSortedSet([1, 3, 2]) == [1, 2, 3]
     """
         
     return FrozenSetTree._ext_cmp(self, other, 2)
示例#4
0
    def __eq__(self, other):
        """
        :param other: A sequence of items.
        :type other: iterable
        :returns: Whether this set is equal to the set of other.
        
        Examples:
        
        >>> assert FrozenSortedSet([1, 3, 2]) == [1, 2, 3]
        """

        return FrozenSetTree._ext_cmp(self, other, 2)
示例#5
0
 def issubset(self, other):
     """
     :param other: A sequence of items.
     :type other: iterable
     :returns: Whether this set is a subset of the set of other.
     
     Examples:
     
     >>> assert FrozenSortedSet([1, 3, 2]).issubset([1, 2, 3, 4])
     >>> assert FrozenSortedSet([1, 4, 3]).issubset([1, 4, 2, 3, 4])
     >>> assert not FrozenSortedSet([1, 3, 2]).issubset([])
     >>> assert FrozenSortedSet([1, 2, 3]).issubset([1, 2, 3])        
     >>> assert FrozenSortedSet([1, 2, 3]) <= [1, 2, 3, 4]
     >>> assert FrozenSortedSet([1, 2, 3]) <= [1, 4, 3, 2]
     """
     
     return FrozenSetTree._ext_cmp(self, other, 0)
示例#6
0
    def issubset(self, other):
        """
        :param other: A sequence of items.
        :type other: iterable
        :returns: Whether this set is a subset of the set of other.
        
        Examples:
        
        >>> assert FrozenSortedSet([1, 3, 2]).issubset([1, 2, 3, 4])
        >>> assert FrozenSortedSet([1, 4, 3]).issubset([1, 4, 2, 3, 4])
        >>> assert not FrozenSortedSet([1, 3, 2]).issubset([])
        >>> assert FrozenSortedSet([1, 2, 3]).issubset([1, 2, 3])        
        >>> assert FrozenSortedSet([1, 2, 3]) <= [1, 2, 3, 4]
        >>> assert FrozenSortedSet([1, 2, 3]) <= [1, 4, 3, 2]
        """

        return FrozenSetTree._ext_cmp(self, other, 0)