We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4add98b commit 66241c3Copy full SHA for 66241c3
python/can/signals.py
@@ -236,6 +236,11 @@ class Filter:
236
to_year: Optional[int] = None
237
years: Optional[Set[int]] = None
238
239
+ def __hash__(self) -> int:
240
+ # Convert the years set to a frozenset to make it hashable
241
+ years_tuple = frozenset(self.years) if self.years is not None else None
242
+ return hash((self.from_year, self.to_year, years_tuple))
243
+
244
def matches(self, model_year: Optional[int]) -> bool:
245
if model_year is not None:
246
if self.from_year is not None and self.to_year is not None:
0 commit comments