>>35
What it does is irrelevant. Perhaps you could use some additional reading comprehension.
You know that the else is being taken by virtue of the control flowing to that point, making the else completely superfluous
The overarching point is that there's never a good reason to do the if return else return idiom; maintainability and clarity both increase (maintainability in multiple ways) when you avoid using that idiom and it doesn't cost anything. In fact, using it costs those things.
My criticism of it (supposing you're still ignorant of it by this point) is that the idiom completely disregards logic and has costs.
In case you're still missing the point, the criticism is not exclusive to your code. You could have something like
def getval(testval):
if testval == 10: return 'a'
elif testval == 21: return 'b'
else: return 'c'
It would still be just as retarded. The code is much more understandable and maintainable if you do it the logical way:
def getval(test):
if testval == 0: return 'a'
if testval == 1: return 'b'
return 'c'