(self, s: str)
return False
Parse a plaintext range of years into a pair of years

        Attempt to turn the input string into a pair of year values, from_year and to_year. If one
        year is passed, both from_year and to_year will be set to that year. If a range like
        '2016-2018' is passed, from_year will be set to 2016, and to_year will be set to 2018.

        Args:
            s: A string representing a range of years or a single year

        Returns:
            True if the range was successfully parsed, False if not.
Parse a plaintext range of years into a pair of years
Parse a plaintext range of years into a pair of years
def parse(self, s: str) -> bool:
        """Parse a plaintext range of years into a pair of years

        Attempt to turn the input string into a pair of year values, from_year and to_year. If one
        year is passed, both from_year and to_year will be set to that year. If a range like
        '2016-2018' is passed, from_year will be set to 2016, and to_year will be set to 2018.

        Args:
            s: A string representing a range of years or a single year

        Returns:
            True if the range was successfully parsed, False if not.
        """
        if s == "all":
            self.from_year = None
            self.to_year = None
            return True
        m = re.match(r"^\d+$", s)
        if m:
            self.from_year = int(s)
            self.to_year = self.from_year
            return True
        m = re.match(r"^(\d+)-(\d+)$", s)
        if m:
            y1, y2 = int(m.group(1)), int(m.group(2))
            if y1 <= y2:
                self.from_year = y1
                self.to_year = y2
                return True
        return False
def parse ( self , s : str ) -> bool : if s == "all" : self . from_year = None self . to_year = None return True m = re . match ( r"^\d+$" , s ) if m : self . from_year = int ( s ) self . to_year = self . from_year return True m = re . match ( r"^(\d+)-(\d+)$" , s ) if m : y1 , y2 = int ( m . group ( 1 ) ) , int ( m . group ( 2 ) ) if y1 <= y2 : self . from_year = y1 self . to_year = y2 return True return False