Most data classes now support hashing.

This commit is contained in:
Rapptz
2015-12-17 00:30:08 -05:00
parent 613214f197
commit 51d91c2a82
8 changed files with 38 additions and 9 deletions

View File

@ -36,6 +36,8 @@ class User:
+-----------+------------------------------------+
| x != y | Checks if two users are not equal. |
+-----------+------------------------------------+
| hash(x) | Return the user's hash. |
+-----------+------------------------------------+
| str(x) | Returns the user's name. |
+-----------+------------------------------------+
@ -66,6 +68,9 @@ class User:
def __ne__(self, other):
return not self.__eq__(other)
def __hash__(self):
return hash(self.id)
@property
def avatar_url(self):
"""Returns a friendly URL version of the avatar variable the user has. An empty string if