Skip to content

Commit eac33b4

Browse files
authored
Merge pull request #66 from tekktrik/dev/fix-pylint-errors
Fix pylint errors
2 parents 59b04c1 + 72b5fda commit eac33b4

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Diff for: 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)