(self)
return Union(intervals, evaluate=False)
The complement of a real finite set is the Union of open Intervals
        between the elements of the set.

        >>> from sympy import FiniteSet
        >>> FiniteSet(1, 2, 3).complement
        (-oo, 1) U (1, 2) U (2, 3) U (3, oo)
The complement of a real finite set is the Union of open Intervals
        between the elements of the set.
The complement of a real finite set is the Union of open Intervals between the elements of the set .
def _complement(self):
        """
        The complement of a real finite set is the Union of open Intervals
        between the elements of the set.

        >>> from sympy import FiniteSet
        >>> FiniteSet(1, 2, 3).complement
        (-oo, 1) U (1, 2) U (2, 3) U (3, oo)


        """
        if not all(elem.is_number for elem in self):
            raise ValueError("%s: Complement not defined for symbolic inputs"
                    % self)

        # as there are only numbers involved, a straight sort is sufficient;
        # default_sort_key is not needed
        args = sorted(self.args)

        intervals = []  # Build up a list of intervals between the elements
        intervals += [Interval(S.NegativeInfinity, args[0], True, True)]
        for a, b in zip(args[:-1], args[1:]):
            intervals.append(Interval(a, b, True, True))  # open intervals
        intervals.append(Interval(args[-1], S.Infinity, True, True))
        return Union(intervals, evaluate=False)
def _complement ( self ) : if not all ( elem . is_number for elem in self ) : raise ValueError ( "%s: Complement not defined for symbolic inputs" % self ) # as there are only numbers involved, a straight sort is sufficient; # default_sort_key is not needed args = sorted ( self . args ) intervals = [ ] # Build up a list of intervals between the elements intervals += [ Interval ( S . NegativeInfinity , args [ 0 ] , True , True ) ] for a , b in zip ( args [ : - 1 ] , args [ 1 : ] ) : intervals . append ( Interval ( a , b , True , True ) ) # open intervals intervals . append ( Interval ( args [ - 1 ] , S . Infinity , True , True ) ) return Union ( intervals , evaluate = False )