'Constructor.
Arguments:
year, month, day (required, base 1)'

def __new__(cls, year, month=None, day=None):

    if (isinstance(year, bytes) and (len(year) == 4) and (1 <= year[2] <= 12) and (month is None)):
        self = object.__new__(cls)
        self.__setstate(year)
        return self
    _check_date_fields(year, month, day)
    self = object.__new__(cls)
    self._year = year
    self._month = month
    self._day = day
    return self
