(cls, date_string)
Construct a date from the output of date.isoformat().
Construct a date from the output of date.isoformat().
Construct a date from the output of date . isoformat () .
def fromisoformat(cls, date_string):
        """Construct a date from the output of date.isoformat()."""
        if not isinstance(date_string, str):
            raise TypeError('fromisoformat: argument must be str')

        try:
            assert len(date_string) == 10
            return cls(*_parse_isoformat_date(date_string))
        except Exception:
            raise ValueError(f'Invalid isoformat string: {date_string!r}')
def fromisoformat ( cls , date_string ) : if not isinstance ( date_string , str ) : raise TypeError ( 'fromisoformat: argument must be str' ) try : assert len ( date_string ) == 10 return cls ( * _parse_isoformat_date ( date_string ) ) except Exception : raise ValueError ( f'Invalid isoformat string: {date_string!r}' )