Derived from the flake8-simplify linter.
Fix is sometimes available.
What it does#
if statements that can be replaced with
Why is this bad?#
dict.get() calls can be used to replace
if statements that assign a
value to a variable in both branches, falling back to a default value if
the key is not found. When possible, using
dict.get is more concise and
Under preview mode, this rule will
also suggest replacing
else expressions with
If preview mode is enabled: