Python-try except else finally有return时执行顺序
http://stackoverflow.com/questions/19805654/python-try-finally-block-returns
def func1(): try: return 1 # ignoring the return finally: return 2 # returns this return def func2(): try: raise ValueError() except: # is going to this exception block, but ignores the return because it needs to go to the finally return 1 finally: return 3 def func3(): return 0 # finds a return here, before the try except and finally block, so it will use this return try: raise ValueError() except: return 1 finally: return 3 func1() # returns 2 func2() # returns 3 func3() # returns 0

浙公网安备 33010602011771号