Fix comparisons between two Object with types

This commit is contained in:
Rapptz 2024-02-22 20:42:14 -05:00
parent 61eddfcb18
commit 56916f9241

View File

@ -102,7 +102,7 @@ class Object(Hashable):
return f'<Object id={self.id!r} type={self.type!r}>'
def __eq__(self, other: object) -> bool:
if isinstance(other, self.type):
if isinstance(other, (self.type, self.__class__)):
return self.id == other.id
return NotImplemented