flake8-simplify
flake8-simplify copied to clipboard
[Adjust Rule] SIM908: odd transform for self-assign
Desired change
- Rule(s): SIM986, SIM987
- Adjustment: In which way should it/they be adjusted?
Explanation
- Invalid transformation for t
Example
This is an example where the mentioned rule(s) would currently be suboptimal:
if "state_dict" in cpt:
cpt = cpt["state_dict"]
cpt = cpt.get("state_dict", cpt)
Is actually harder to read in this case.