diff --git a/discord/permissions.py b/discord/permissions.py index 4c2d5f700f..a72a6290f4 100644 --- a/discord/permissions.py +++ b/discord/permissions.py @@ -526,6 +526,10 @@ class PermissionOverwrite: +-----------+------------------------------------------+ | Operation | Description | +===========+==========================================+ + | x == y | Checks if two overwrites are equal. | + +-----------+------------------------------------------+ + | x != y | Checks if two overwrites are not equal. | + +-----------+------------------------------------------+ | iter(x) | Returns an iterator of (perm, value) | | | pairs. This allows this class to be used | | | as an iterable in e.g. set/list/dict | @@ -549,6 +553,9 @@ def __init__(self, **kwargs): setattr(self, key, value) + def __eq__(self, other): + return self._values == other._values + def _set(self, key, value): if value not in (True, None, False): raise TypeError('Expected bool or NoneType, received {0.__class__.__name__}'.format(value))