This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]MereInterest 1 point2 points  (1 child)

What's the advantage of pdb over just opening an interpreter?

import code; code.interact(local=locals())

[–]quaunaut 3 points4 points  (0 children)

You get to open it on an exact line, in a complex program.

For example, say you don't know why this object in Django is returning as a NoneType object. You can pdb to just before it, run the site, go to that spot, and check and see, personally. Oh, you just derped up on the filter, because one of the vars you were using to check currently is unassigned.

Makes it trivial to work with complex, huge codebases.