mirror of https://github.com/astral-sh/ruff
## Summary Resolves #19531 I've implemented a check to determine whether the for_stmt target is declared as global or nonlocal. I believe we should skip the rule in all such cases, since variables declared this way are intended for use outside the loop scope, making value changes expected behavior. ## Test Plan Added two test cases for global and nonlocal variable to snapshot. |
||
|---|---|---|
| .. | ||
| PERF101.py | ||
| PERF102.py | ||
| PERF203.py | ||
| PERF401.py | ||
| PERF402.py | ||
| PERF403.py | ||