Most data classes now support hashing.

This commit is contained in:
Rapptz committed 2015-12-17 00:32:54 -05:00
1 parent 613214f197
commit 51d91c2a82
8 files changed
+38 -9

No files matched your search

+5
View File
@@ -36,6 +36,8 @@ class Permissions(object):
+-----------+------------------------------------------+
| x != y | Checks if two permissions are not equal. |
+-----------+------------------------------------------+
| hash(x) | Return the permission's hash. |
+-----------+------------------------------------------+
Attributes
-----------
@@ -57,6 +59,9 @@ class Permissions(object):
def __ne__(self, other):
return not self.__eq__(other)
def __hash__(self):
return hash(self.value)
@classmethod
def none(cls):
"""A factory method that creates a :class:`Permission` with all