【发布时间】:2018-06-04 18:36:41
【问题描述】:
我在提醒自己“关键字”时无意中发现了这篇文章http://effbot.org/zone/python-with-statement.htm。我只是有一个很小的,可能很明显的问题。文章指出,这“吞下任何 TypeError”
def __exit__(self, type, value, traceback):
return isinstance(value, TypeError)
我不太明白这是怎么回事?快速解释将不胜感激?
【问题讨论】:
标签: python python-3.x error-handling