"Else" and "Return" vs. "Return"


#1

Is it pointless to have the lines:

else:
  return x #where x is any result

instead of:

return x

to end a function? Is there any difference since everything that would reach return x would fall under an implied “else” anyway, right?

For example:

def isPositiveNumber(n):
  if n > 0:
    return True
  else:
    return False

vs.

def isPositiveNumber(n):
  if n > 0:
    return True
  return False

P.S. (Not the original idea, but I just realized that this might work with anything–not just return–so the title is a misnomer. Sorry.)


#2

When there are returns in all the if branches, neither elif nor else are required anywhere.

if ...: return ...
if ...: return ...
return ...

Consider that each step along the way is another default case.