This seems to be a regression in 2.0.
def function(val):
if val == 1:
return 1
elif val == 2:
return 2
return 0
This currently raises:
pylint_bug2.py:2:4: R1705: Unnecessary "else" after "return" (no-else-return)
Obviously, I am ignoring the complaints on the docstrings.
Well, the code avoids precisely the issue raised by pylint, there is no else!
pylint 2.0.0
astroid 2.0.0.dev4
Python 3.6.5 (default, Apr 1 2018, 05:46:30)
[GCC 7.3.0]
dupe of #2295
Ok, and that's a feature, apparently.
Yes, that's a feature.