[Python-Dev] short-circuiting runtime errors/exceptions in python debugger.

Chris Angelico rosuav at gmail.com
Mon Oct 29 20:27:02 EDT 2018


On Tue, Oct 30, 2018 at 11:10 AM Nathaniel Smith <njs at pobox.com> wrote:
> I also wonder if it would be useful to give pdb the ability to break
> when an exception is *raised*, rather than when it's caught?

This is veering into python-ideas territory (or even python-list), but
the first big concern that comes to my mind is that there are a LOT of
places where exceptions are raised, and many of those exceptions end
up being used for perfectly-normal flow control. So this would
potentially add even more overhead to the raising of exceptions -
basically, you have to retain state as if you're suspending a
generator. But it'd be an extremely cool concept. Exceptions already
snapshot all their locals, and this would just expand on that a bit.

ChrisA


More information about the Python-Dev mailing list