From 633192b3cda8d9a8cbe294960604ef7d46ce6ea1 Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Fri, 22 Jun 2018 16:56:02 +0200 Subject: [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). --- discord/permissions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'discord/permissions.py') 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.') -- cgit v1.2.3