Most of the Python developers reading this book might already be aware of the usage of python debugger (pdb). For those who are not aware of it, pdb is an interactive source code debugger for Python programs. We can set breakpoints wherever needed, debug using single stepping at the source line level, and inspect the stack frames.
Many new developers might be of the opinion that the job of a debugger can be handled using a logger, but debuggers provide a much deeper insight into the flow of control, preserve the state at each step, and hence potentially save a lot of development time. In this recipe, let's have a look at what pdb brings to the table.