(self, other)
return None
This function should only be used internally

        See Set._union for docstring
This function should only be used internally
This function should only be used internally
def _union(self, other):
        """
        This function should only be used internally

        See Set._union for docstring
        """
        if other.is_Interval and self._is_comparable(other):
            from sympy.functions.elementary.miscellaneous import Min, Max
            # Non-overlapping intervals
            end = Min(self.end, other.end)
            start = Max(self.start, other.start)
            if (end < start or
               (end == start and (end not in self and end not in other))):
                return None
            else:
                start = Min(self.start, other.start)
                end = Max(self.end, other.end)

                left_open = ((self.start != start or self.left_open) and
                             (other.start != start or other.left_open))
                right_open = ((self.end != end or self.right_open) and
                              (other.end != end or other.right_open))

                return Interval(start, end, left_open, right_open)

        # If I have open end points and these endpoints are contained in other
        if ((self.left_open and other.contains(self.start) is True) or
                (self.right_open and other.contains(self.end) is True)):
            # Fill in my end points and return
            open_left = self.left_open and self.start not in other
            open_right = self.right_open and self.end not in other
            new_self = Interval(self.start, self.end, open_left, open_right)
            return set((new_self, other))

        return None
def _union ( self , other ) : if other . is_Interval and self . _is_comparable ( other ) : from sympy . functions . elementary . miscellaneous import Min , Max # Non-overlapping intervals end = Min ( self . end , other . end ) start = Max ( self . start , other . start ) if ( end < start or ( end == start and ( end not in self and end not in other ) ) ) : return None else : start = Min ( self . start , other . start ) end = Max ( self . end , other . end ) left_open = ( ( self . start != start or self . left_open ) and ( other . start != start or other . left_open ) ) right_open = ( ( self . end != end or self . right_open ) and ( other . end != end or other . right_open ) ) return Interval ( start , end , left_open , right_open ) # If I have open end points and these endpoints are contained in other if ( ( self . left_open and other . contains ( self . start ) is True ) or ( self . right_open and other . contains ( self . end ) is True ) ) : # Fill in my end points and return open_left = self . left_open and self . start not in other open_right = self . right_open and self . end not in other new_self = Interval ( self . start , self . end , open_left , open_right ) return set ( ( new_self , other ) ) return None