Search code examples
pythondebuggingipdb

ipdb debugger, step out of cycle


Is there a command to step out of cycles (say, for or while) while debugging on ipdb without having to use breakpoints out of them?

I use the until command to step out of list comprehensions, but don't know how could I do a similar thing, if possible, of entire loop blocks.


Solution

  • This could sound obvious: jump makes you jump. This means that you don't execute the lines you jump: you should use this to skip code that you don’t want to run.

    You probably need tbreak (Temporary breakpoint, which is removed automatically when it is first hit. The arguments are the same as break) as I did when I found this page.