Skip to content

Commit

Permalink
[Units] Handle other not WikiArticle in WikiArticle.__eq__
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmon758 committed Jul 30, 2023
1 parent a372806 commit 7465798
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion units/wikis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7465798

Please sign in to comment.