def __init__(self, year, month, day, original_string=None):
        """Create a new DateValue. Placeholders are marked as -1."""
        assert isinstance(year, int)
        assert isinstance(month, int) and (month == -1 or 1 <= month <= 12)
        assert isinstance(day, int) and (day == -1 or 1 <= day <= 31)
        assert not year == month == day == -1
        self._year = year
        self._month = month
        self._day = day
        if not original_string:
            self._normalized = '{}-{}-{}'.format(
                    year if year != -1 else 'xx',
                    month if month != -1 else 'xx',
                    day if day != '-1' else 'xx')
        else:
            self._normalized = normalize(original_string)
        self._hash = hash((self._year, self._month, self._day))
def __init__ ( self , year , month , day , original_string = None ) : assert isinstance ( year , int ) assert isinstance ( month , int ) and ( month == - 1 or 1 <= month <= 12 ) assert isinstance ( day , int ) and ( day == - 1 or 1 <= day <= 31 ) assert not year == month == day == - 1 self . _year = year self . _month = month self . _day = day if not original_string : self . _normalized = '{}-{}-{}' . format ( year if year != - 1 else 'xx' , month if month != - 1 else 'xx' , day if day != '-1' else 'xx' ) else : self . _normalized = normalize ( original_string ) self . _hash = hash ( ( self . _year , self . _month , self . _day ) )
Create a new DateValue. Placeholders are marked as -1.