J
Jessica Ross
I found something like this in a StackOverflow discussion..... try:
.... raise Exception("Exception raised during try")
.... except:
.... print "Except after try"
.... return True
.... finally:
.... print "Finally"
.... return False
.... return None
....Except after try
FinallyFalse
I understand most of this.
What I don't understand is why this returns False rather than True. Does the finally short-circuit the return in the except block?
.... raise Exception("Exception raised during try")
.... except:
.... print "Except after try"
.... return True
.... finally:
.... print "Finally"
.... return False
.... return None
....Except after try
FinallyFalse
I understand most of this.
What I don't understand is why this returns False rather than True. Does the finally short-circuit the return in the except block?