You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I think it would be compatible with both rules to do something more like:
diff --git a/tmp.py b/tmp2.py
index dfa6d6f..6975214 100644
--- a/tmp.py+++ b/tmp2.py@@ -1,9 +1,8 @@
outdated = []
skipped = []
-for package in packages.keys():+for package, version in packages.items():
norm_name = pep423_name(package)
if norm_name in updated_packages:
- version = packages[package]
if isinstance(version, Mapping):
version = parse_version(version.get("version", "").replace("==", ""))
else:
But I can't quite tell from your code if you're trying to mutate the dictionary key at that point, in which case you'd have to do something else. (The above patch would also violate redefined-loop-name (PLW2901), so if that rule is also enabled you would have to name the loop variable something else).
First it tells me no to use:
When I try
dict.keys
it still complains.When I try `dict.item() and throw away value, it still complains:
I believe PLC0206 should not be raised if I use
dict.keys()
The text was updated successfully, but these errors were encountered: