Suddenly I was curious, so I tried it. Confirmed with Python 2.7 and Python 3.4.
return in try and finally clauses
def f():
try:
return "try"
finally:
return "finally"
print(f())
⇒finally
return in except and finally clauses
def f():
try:
raise ValueError
except ValueError:
return "except"
finally:
return "finally"
print(f())
⇒finally
I probably won't use it. I did not know.