def standardise(self): """Format self.value into a standard representation.""" try: self.value = str(interval_parse(self.value)) except ValueError: raise IntervalParsingError(type(self), self.value) return self
def __init__(self, value): if (not isinstance(value, basestring) or not REC_INTERVAL.search(value)): raise IntervalParsingError("IntegerInterval", repr(value)) super(IntegerInterval, self).__init__(value)