I think this can be a moot point. The first one is not syntactically correct:
if conditional: return True else return False
In Python, the else clause, like everything that the set enters, must end with the character :
If you fix this, then they are both syntactically valid and both semantically significant. In fact, they mean the same thing. They even compile using almost the same code, except that the first can cause Python to generate additional code for the third case, "fall off the end", which is never called.
But, as iCodez explains, both of them are anti-patterns; just return conditional or return bool(conditional) if necessary.
Note that even if the conditional evaluation throws an exception, the different options are still equivalent (up to the contents of the trace) - they all just raise this exception.
source share