I'm looking through my RC file and I can't for the life of me, find which one of these variables disables that feature.
I searched for "if", "else" and "return" and I didn't see anything. Unless I've missed it.
Thanks.
More Info
pylint 1.7.2,
astroid 1.5.3
Python 2.7.10 (default, Jul 30 2016, 18:31:42)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
What I'm putting into the terminal
pylint --rcfile=.pylintrc Test.py
Test code
""" Module Docstring """
def IS_POSITIVE(number):
""" detects positive """
if number > 0:
return "+++"
else:
return "---"
print IS_POSITIVE(3)
The print out
************* Module Test
R: 27, 4: Unnecessary "else" after "return" (no-else-return)
------------------------------------------------------------------
Your code has been rated at 8.00/10 (previous run: 8.00/10, +0.00)
return "---"
. There is a question about which of these is preferred in Python and I don't think there is a clear answer, but it appears that pylint weighs in on the "no else" side. – Bernardinebernardono-return-else
. – Equation