[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).
This commit is contained in:
Hornwitser authored and Rapptz committed 2018-11-24 22:17:57 -05:00
1 parent fa46b07db1
commit 633192b3cd
3 files changed
+11 -11

No files matched your search

+2 -2
View File
@@ -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.')