Running
flake8==3.9.2
flake8-bugbear==21.4.3
flake8-polyfill==1.0.2
flake8-quotes==3.2.0
on
def main():
def f(x):
print(i, x)
for i in [1, 2, 3]:
f('HI')
gives me
bugbearbug.py:5:9: B007 Loop control variable 'i' not used within the loop body. If this is intended, start the name with an underscore.
Clearly, i is being used (within the nested function), but bugbear doesn't seem to see it.
Running
on
gives me
Clearly,
iis being used (within the nested function), but bugbear doesn't seem to see it.