mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
![]() Fixes #15012. ```python def f(): # panics when the code can't find the loop variable values = [1, 2, 3] result = [] for i in values: result.append(i + 1) del i ``` I'm not sure exactly why this test case panics, but I suspect the `del i` removes the binding from the semantic model's symbols. I changed the code to search for the correct binding by directly iterating through the bindings. Since we know exactly which binding we want, this should find the loop variable without any complications. |
||
---|---|---|
.. | ||
resources | ||
src | ||
Cargo.toml |