Skip to content

Commit 72b5fda

Browse files
authored
Fix pylint errors
1 parent 59b04c1 commit 72b5fda

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

simpleio.py

+2-5
Original file line numberDiff line numberDiff line change
@@ -171,12 +171,9 @@ def shift_out(data_pin, clock, value, msb_first=True, bitcount=8):
171171
if bitcount < 0 or bitcount > 32:
172172
raise ValueError("bitcount must be in range 0..32 inclusive")
173173

174-
if msb_first:
175-
bitsequence = lambda: range(bitcount - 1, -1, -1)
176-
else:
177-
bitsequence = lambda: range(0, bitcount)
174+
bitsequence = range(bitcount - 1, -1, -1) if msb_first else range(bitcount)
178175

179-
for i in bitsequence():
176+
for i in bitsequence:
180177
tmpval = bool(value & (1 << i))
181178
data_pin.value = tmpval
182179
# toggle clock pin True/False

0 commit comments

Comments
 (0)