aboutsummaryrefslogtreecommitdiff
path: root/discord/permissions.py
diff options
context:
space:
mode:
authorHornwitser <[email protected]>2018-06-22 16:56:02 +0200
committerRapptz <[email protected]>2018-11-24 22:17:57 -0500
commit633192b3cda8d9a8cbe294960604ef7d46ce6ea1 (patch)
tree028680e11b98696938f5ce3f8803029f804ec253 /discord/permissions.py
parent[lint] Rename exception variables to exc (diff)
downloaddiscord.py-633192b3cda8d9a8cbe294960604ef7d46ce6ea1.tar.xz
discord.py-633192b3cda8d9a8cbe294960604ef7d46ce6ea1.zip
[lint] Replace equality comparisons to singletons
Restrict the values accepted by comparisons with booleans to be actual booleans. Minor breaking of undocumented behaviour in permissions; the value to set bits to must be booleans (as indicated by the type error thrown).
Diffstat (limited to 'discord/permissions.py')
-rw-r--r--discord/permissions.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/discord/permissions.py b/discord/permissions.py
index cb546668..1a8866a3 100644
--- a/discord/permissions.py
+++ b/discord/permissions.py
@@ -193,9 +193,9 @@ class Permissions:
return bool((self.value >> index) & 1)
def _set(self, index, value):
- if value == True:
+ if value is True:
self.value |= (1 << index)
- elif value == False:
+ elif value is False:
self.value &= ~(1 << index)
else:
raise TypeError('Value to set for Permissions must be a bool.')