【发布时间】:2012-07-18 02:46:27
【问题描述】:
我不确定为什么我们在 try...except...finally 语句中需要 finally。在我看来,这个代码块
try:
run_code1()
except TypeError:
run_code2()
other_code()
使用finally与这个相同:
try:
run_code1()
except TypeError:
run_code2()
finally:
other_code()
我错过了什么吗?
【问题讨论】:
标签: python exception-handling try-finally