-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
acceptedReady for implementationReady for implementationgood first issueGood for newcomersGood for newcomershelp wantedContributions especially welcomeContributions especially welcome
Description
In #4932, there was a bug because if-else blocks were rewritten as ternary operations which SIM401 wouldn't be able to fix. The bug was fixed but there's still the fact that you can have code like
obj: dict = ...
key = ...
value = obj[key] if key in obj else "Not found"which will not be corrected with ruff check --fix --select SIM .
Expected behavior:
obj: dict = ...
key = ...
value = obj.get(key, "Not found")Checked with ruff v0.0.287
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
acceptedReady for implementationReady for implementationgood first issueGood for newcomersGood for newcomershelp wantedContributions especially welcomeContributions especially welcome