-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
SIM911 has a false positive if you give the methods args, since they are removed when it is transformed into .items(), which changes the behavior of the code to no longer raise a TypeError. If there is a situation in where the code thinks the variable is a dict, but it's actually the dict class, that could actually show up in non-constructed code. I was unable to find such a situation though. playground
PS ~\Desktop\New_folder>Get-Content issue.py
d = {}
for country, stars in zip(d.keys(*x), d.values("hello")):...PS ~\Desktop\New_folder>uvx ruff check issue.py --isolated --select SIM --fix --diff
--- issue.py
+++ issue.py
@@ -1,2 +1,2 @@
d = {}
-for country, stars in zip(d.keys(*x), d.values("hello")):...
+for country, stars in d.items():...
Would fix 1 error.Version
ruff 0.12.0 (87f0feb 2025-06-17) + playground
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working