Skip to content

Commit afb1d9b

Browse files
committed
fix comparison
1 parent 8edbf4c commit afb1d9b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

adafruit_fancyled/adafruit_fancyled.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,11 @@ def __len__(self):
120120

121121
def __getitem__(self, key):
122122
"""Retrieve red, green or blue value as iterable."""
123-
if key is 0:
123+
if key == 0:
124124
return self.red
125-
elif key is 1:
125+
elif key == 1:
126126
return self.green
127-
elif key is 2:
127+
elif key == 2:
128128
return self.blue
129129
else:
130130
raise IndexError
@@ -185,11 +185,11 @@ def __len__(self):
185185

186186
def __getitem__(self, key):
187187
"""Retrieve hue, saturation or value as iterable."""
188-
if key is 0:
188+
if key == 0:
189189
return self.hue
190-
elif key is 1:
190+
elif key == 1:
191191
return self.saturation
192-
elif key is 2:
192+
elif key == 2:
193193
return self.value
194194
else:
195195
raise IndexError

0 commit comments

Comments
 (0)