17
18 prev_tok = None
19 prev_val = None
20 for i, (tok, val) in enumerate(list(seq)): 21 if tok == prev_tok and (val == prev_val or _val_eq(val, prev_val)):
22 if tok == MAX_REPEAT:
23 min_repeat = min(MAXREPEAT, prev_val[0] + val[0])
An unused variable takes up space in the code, and can lead to confusion, and it should be removed. If this variable is necessary, name the variable _
to indicate that it will be unused, or start the name with unused
or _unused
.
def update():
for i in range(10): # Usused variable `i`
time.sleep(0.01)
display_result()
def update():
for _ in range(10):
time.sleep(0.01)
display_result()