diff options
| author | Rapptz <[email protected]> | 2017-08-09 18:39:32 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-08-09 18:39:32 -0400 |
| commit | f554861e689544a42f59d7e944f03bf1ad238a14 (patch) | |
| tree | c78a0289c0284376593a7cbb08fbe161f6ad02e7 | |
| parent | Disallow setting non-permission attributes (diff) | |
| download | discord.py-f554861e689544a42f59d7e944f03bf1ad238a14.tar.xz discord.py-f554861e689544a42f59d7e944f03bf1ad238a14.zip | |
Make discord.Object hashable.
| -rw-r--r-- | discord/object.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/discord/object.py b/discord/object.py index 1044abad..9cb40ecc 100644 --- a/discord/object.py +++ b/discord/object.py @@ -24,8 +24,9 @@ DEALINGS IN THE SOFTWARE. """ from . import utils +from .mixins import Hashable -class Object: +class Object(Hashable): """Represents a generic Discord object. 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 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 ----------- id : str |