From 7465798223eb04d073cfc47a87d1213dda723f8f Mon Sep 17 00:00:00 2001 From: Harmon Date: Sun, 30 Jul 2023 09:15:55 -0500 Subject: [PATCH] [Units] Handle other not WikiArticle in WikiArticle.__eq__ --- units/wikis.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/units/wikis.py b/units/wikis.py index 7f70c2f11d..86628c2015 100644 --- a/units/wikis.py +++ b/units/wikis.py @@ -29,7 +29,10 @@ class WikiArticle(BaseModel): wiki: WikiInfo def __eq__(self, other): - return self.url == other.url + if isinstance(other, WikiArticle): + return self.url == other.url + else: + return NotImplemented def __hash__(self) -> int: return hash(self.url)