Skip to content

Commit 7e5f257

Browse files
committed
Linted
1 parent 53240e3 commit 7e5f257

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

adafruit_matrixkeypad.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,15 @@ def pressed_keys(self):
6262
pin.direction = Direction.INPUT
6363
pin.pull = Pull.UP
6464

65-
for row in range(len(self.row_pins)):
65+
for row in range( # pylint: disable=consider-using-enumerate
66+
len(self.row_pins)
67+
):
6668
# set one row low at a time
6769
self.row_pins[row].direction = Direction.OUTPUT
6870
self.row_pins[row].value = False
6971
# check the column pins, which ones are pulled down
70-
for col in range(len(self.col_pins)):
71-
if not self.col_pins[col].value:
72+
for col, val in enumerate(self.col_pins):
73+
if not val.value:
7274
pressed.append(self.keys[row][col])
7375
# reset the pin to be an input
7476
self.row_pins[row].direction = Direction.INPUT

0 commit comments

Comments
 (0)