Make discord.Object hashable.
This commit is contained in:
parent
ecdd21212c
commit
f554861e68
@ -24,8 +24,9 @@ DEALINGS IN THE SOFTWARE.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
from . import utils
|
from . import utils
|
||||||
|
from .mixins import Hashable
|
||||||
|
|
||||||
class Object:
|
class Object(Hashable):
|
||||||
"""Represents a generic Discord object.
|
"""Represents a generic Discord object.
|
||||||
|
|
||||||
The purpose of this class is to allow you to create 'miniature'
|
The purpose of this class is to allow you to create 'miniature'
|
||||||
@ -39,6 +40,20 @@ class Object:
|
|||||||
receive this class rather than the actual data class. These cases are
|
receive this class rather than the actual data class. These cases are
|
||||||
extremely rare.
|
extremely rare.
|
||||||
|
|
||||||
|
.. container:: operations
|
||||||
|
|
||||||
|
.. describe:: x == y
|
||||||
|
|
||||||
|
Checks if two objects are equal.
|
||||||
|
|
||||||
|
.. describe:: x != y
|
||||||
|
|
||||||
|
Checks if two objects are not equal.
|
||||||
|
|
||||||
|
.. describe:: hash(x)
|
||||||
|
|
||||||
|
Returns the object's hash.
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
-----------
|
-----------
|
||||||
id : str
|
id : str
|
||||||
|
Loading…
x
Reference in New Issue
Block a user