Awesome Conferences

Introducing the Python Time Travel Debugger

Today I'm open sourcing a productivity tool that I've been very excited about: A time-travel extension to the Python Debugger (PDB).

Have you ever been using PDB to step through a program and suddenly realize you wish you could jump back in time and know what a variable used to contain?

This version of PDB adds the ability to jump back in time to the state of your program as it was in the past. You can examine variables and even continue execution from that point forward (though that is dangerous because it may harm the time space continuum.)

How it works:

As you know, time is the 4th dimension. Every moment is another universe. Pretty trippy, eh?

TTPDB simply records a pointer to the current universe before displaying the input prompt. As you step through your program, each step records a pointer to the past universes. The last 100 pointers are remembered. You can jump into any of those universes. Once in those universes you can examine variables. Heck you can do anything you want because you are really in that universe.

Once you are done with that universe you can "pop up" back to the universe you left thanks to our time portal technology.

I've released the source code. You can find it on Github:


--Tom Limoncelli

Posted by Tom Limoncelli in Python

No TrackBacks

TrackBack URL:

6 Comments | Leave a comment

This is awesome. I can't wait to have something similar in the Perl debugger!


Hey, this is actually pretty cool! Totally planning on messing with this more later.

I'm just gonna leave this here though, for anyone else who might need it ...

kill -SIGQUIT `ps -ef | grep "python2 -m timetravelpdb" | awk '{print $2}'`

(Thanks to )

(Be a bit careful with that command by the way.)

Hi, have you seen the Python Omniscient Debugger ?

I guess this uses copy on write underneath ? Does it use a lot of RAM, what are the implications for having many more than 100 runs ?

Ability to jump back is very helpful feature of Python Debugger

Ability to jump back is very helpful feature of Python Debugger

Leave a comment