Add support for specifying the type of a generic discord.Object

Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
This commit is contained in:
Josh
2022-08-07 04:23:37 +10:00
committed by GitHub
parent 842d6b4fbb
commit 1787867320
2 changed files with 25 additions and 10 deletions

View File

@ -34,12 +34,9 @@ class EqualityComparable:
id: int
def __eq__(self, other: object) -> bool:
return isinstance(other, self.__class__) and other.id == self.id
def __ne__(self, other: object) -> bool:
if isinstance(other, self.__class__):
return other.id != self.id
return True
return other.id == self.id
return NotImplemented
class Hashable(EqualityComparable):