When an if/elif statement is used and the if has a return, the plugin erroneously states that the else is not necessary because if has a return, when it should be recognizing that elif is being used which states a condition and not else.
Steps To Reproduce
Write some Python with an if/elif block, ensure that the if statement has a return
Expected Behavior
There should be no warning on if/elif blocks for the if no return else check
Additional Context
What versions of software are you using?
Operating System: Ventura 13.6.4
IDE version: PyCharm 2023.3.3 (Professional Edition)
Describe the bug
When an
if/elif
statement is used and theif
has a return, the plugin erroneously states that the else is not necessary becauseif
has a return, when it should be recognizing thatelif
is being used which states a condition and notelse
.Steps To Reproduce
if/elif
block, ensure that theif
statement has areturn
Expected Behavior
There should be no warning on
if/elif
blocks for theif no return else
checkAdditional Context
What versions of software are you using?