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:
JoshandDanny authored and GitHub committed 2022-08-06 14:23:37 -04:00
1 parent 842d6b4fbb
commit 1787867320
2 files changed
+25 -10

No files matched your search

+2 -5
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):