Open nijel opened 1 year ago
The very same issue is with return and R505:
def test_2(bar):
if bar == 3:
baz = 1
elif bar == 4:
return 3
else:
baz = 2
return baz
$ flake8 test.py
test.py:4:5: R505 unnecessary else after return statement.
Description
Linting following code:
What I Did
The else is necessary as there is additional if before which has side effects and removing else would overwrite that. The code is simplified from real-world code.