Derived from the flake8-bugbear linter.
What it does#
Checks for function definitions that use a loop variable.
Why is this bad?#
The loop variable is not bound in the function definition, so it will always have the value it had in the last iteration when the function is called.
Instead, consider using a default argument to bind the loop variable at
function definition time. Or, use