ruff
e4f64480 - [`perflint`] Ignore rule if target is `global` or `nonlocal` (`PERF401`) (#19539)

Commit
164 days ago
[`perflint`] Ignore rule if target is `global` or `nonlocal` (`PERF401`) (#19539) ## 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.
Author
Parents
Loading