'Inverse of set as a new set.'

def inverse(self):

    newset = self.__class__.__new__(self.__class__)
    newset._min = self._min
    newset._max = self._max
    newset._ranges = []
    laststop = self._min
    for r in self._ranges:
        if (laststop < r[0]):
            newset._ranges.append((laststop, r[0]))
            laststop = r[1]
    if (laststop < self._max):
        newset._ranges.append((laststop, self._max))
    return newset
