当我在当前的Python环境(一个IPython记事本单元格)中尝试这个简单的示例时,我无法捕获TypeError异常:try:except TypeError'> 'tuple' object does not support item assignment
当我试图在同一台计算机上的不同的ipython笔记本上运行相同的复制粘贴代码
考虑一下 f(*args, **kwargs) print "doh!"在这种情况下,TypeError的原因可能是函数参数中的一个问题,例如f() got an unexpected keyword argument 'b'。但是,TypeError也可能由于函数体本身的问题而引起,例如list indices must be integers, not str。我想