A python class for intervals.