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
for_inrange(3):
[xforxin []]
deffunc():
lambdax: x
command:
ruff check --isolated --select B023 demo.py
log:
demo.py:5:19: B023 Function definition does not bind loop variable `x`
|
4 | def func():
5 | lambda x: x
| ^ B023
|
Found 1 error.
ruff version: 0.9.2
This is NOT a duplicate of #7847, because x is only used in a list comprehension in the same loop. Ruff should not raise a false positive in this situation.
The text was updated successfully, but these errors were encountered:
Description
minimal code snippet:
command:
log:
ruff version: 0.9.2
This is NOT a duplicate of #7847, because
x
is only used in a list comprehension in the same loop. Ruff should not raise a false positive in this situation.The text was updated successfully, but these errors were encountered: