Desired change
- Rule(s): SIM106
- Adjustment: Make an exception for the NotImplementedError
Explanation
Throwing an exception for potentially forgotten implementation is better than potentially returning None or making the last one catch all.
Example
if merge_method in ["take_right_shallow", "take_right_deep"]:
...
elif merge_method == "take_left_shallow":
...
elif merge_method == "take_left_deep":
...
elif merge_method == "sum":
...
else:
raise NotImplementedError
Desired change
Explanation
Throwing an exception for potentially forgotten implementation is better than potentially returning None or making the last one catch all.
Example