title: Python - start interactive debugger when exception would be otherwise thrown
body: <p>Is there any way to make a python program start an interactive debugger, like what <code>import pdb; pdb.set_trace()</code> instead of actually throwing an exception?</p>
  
  <p>I know the difficulty of making this work, but it would be much more valuable than a huge stack trace after which I have to use to figure out where to insert breakpoints and then restart the program to debug it. I know that simply making the debugger start instead of throwing an exception would not make sense because any exception can be caught at a level or another, so <em>if I could just select a list of exceptions for which an interactive debug session would start <strong>instead</strong> of them being thrown</em> (because I know the exceptions in this list would really be "errors" and no meaningful program behavior could follow afterwards)...</p>
  
  <p>I've heard that Common Lisp has something like this, but I don't know how it works exactly, just that "true lispers" praise it a lot...</p>