157 def __sub__(self, other) -> FaviconCacheStats:
158 if not isinstance(other, self.__class__):
159 raise TypeError(f"unsupported operand type(s) for +: '{self.__class__}' and '{type(other)}'")
160 kwargs = {}
161 for field, _, _ in self.field_descr:
162 self_val, other_val = getattr(self, field), getattr(other, field)
163 if None in (self_val, other_val):
164 continue
165 if isinstance(self_val, int):
166 kwargs[field] = self_val - other_val
167 else:
168 kwargs[field] = self_val
169 return self.__class__(**kwargs)
170