You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example is obviously too simple to be realistic - our actual code has more logic in foo() and passes parameters to it, but is equivalent in terms of everything the rule cares about. We get an error of Function definition does not bind loop variable 'i'.Flake8(B023). This should not happen because foo is not a closure. It's never called outside the loop, and execution is never delayed. i should always have the correct value.
The reason we aren't immediately doing mydict[arr[i]] = 0 is because we have other logic that determines the parameters passed to foo().
The text was updated successfully, but these errors were encountered:
This example is obviously too simple to be realistic - our actual code has more logic in
foo()
and passes parameters to it, but is equivalent in terms of everything the rule cares about. We get an error ofFunction definition does not bind loop variable 'i'.Flake8(B023)
. This should not happen becausefoo
is not a closure. It's never called outside the loop, and execution is never delayed.i
should always have the correct value.The reason we aren't immediately doing
mydict[arr[i]] = 0
is because we have other logic that determines the parameters passed tofoo()
.The text was updated successfully, but these errors were encountered: