<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def difference(self, other):
 """ Compute the difference between this and a given range. intrange([1,10)) intrange([1,5)) intrange([1,5)) intrange(empty) The difference can not be computed if the resulting range would be split in two separate ranges. This happens when the given range is completely within this range and does not start or end at the same value. Traceback (most recent call last):
 File "<stdin>", line 1, in <module> ValueError: Other range must not be within this range This does not modify the range in place. This is the same as the ``-`` operator for two ranges in PostgreSQL. :param other: Range to difference against. :return: A new range that is the difference between this and `other`. :raises ValueError: If difference bethween this and `other` can not be computed. """


        if not self.is_valid_range(other):
            msg = "Unsupported type to test for difference '{.__class__.__name__}'"
            raise TypeError(msg.format(other))

        # Consider empty ranges or no overlap
        if not self or not other or not self.overlap(other):
            return self
        # If self is contained within other, the result is empty
        elif self in other:
            return self.empty()
        elif other in self and not (self.startswith(other) or self.endswith(other)):
            raise ValueError("Other range must not be within this range")
        elif self.endsbefore(other):
            return self.replace(upper=other.lower, upper_inc=not other.lower_inc)
        elif self.startsafter(other):
            return self.replace(lower=other.upper, lower_inc=not other.upper_inc)
        else:
            return self.empty()