mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-04 08:56:19 +00:00
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:
@ -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):
|
||||
|
Reference in New Issue
Block a user