(self, t: datetime.datetime)
For the given t, update from_year and to_year to include that timestamp
For the given t, update from_year and to_year to include that timestamp
For the given t update from_year and to_year to include that timestamp
def add(self, t: datetime.datetime) -> None:
        """For the given t, update from_year and to_year to include that timestamp"""
        if self.from_year is None:
            self.from_year = t.year
            self.to_year = t.year
            return

        assert self.from_year is not None
        assert self.to_year is not None
        if t.year < self.from_year:
            self.from_year = t.year
        elif t.year > self.to_year:
            self.to_year = t.year
def add ( self , t : datetime . datetime ) -> None : if self . from_year is None : self . from_year = t . year self . to_year = t . year return assert self . from_year is not None assert self . to_year is not None if t . year < self . from_year : self . from_year = t . year elif t . year > self . to_year : self . to_year = t . year