Fix FP for py/modification-of-locals

This commit is contained in:
Owen Mansel-Chan
2026-06-17 14:24:18 +01:00
parent 47c2c9e763
commit dd61dd2d74
3 changed files with 15 additions and 8 deletions

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The `py/modification-of-locals` query no longer flags modifications of a `locals()` dictionary that has been passed out of the scope in which `locals()` was called (for example, by passing it to another function or storing it in an instance attribute). In such cases the dictionary is used as an ordinary mapping and modifying it is meaningful, so these were false positives. The "modification has no effect" claim only applies within the scope that called `locals()`, which is now the only case reported.