Make discord.Object hashable.
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user