Summary

This chapter explained a few different debugging techniques and gotchas. There is, of course, much more that can be said about debugging, but I hope you have acquired a nice vantage point for debugging your Python code now. Interactive debugging techniques are very useful for single-threaded applications and locations where interactive sessions are available. But since that's not always the case, we also discussed some non-interactive options.

Here's an overview of all the points discussed in this chapter:

  • Non-interactive debugging using:
    • print
    • logging
    • trace
    • traceback
    • asyncio
    • faulthandler
  • Interactive debugging using both pdb and ipdb

In the next chapter, we will see how to monitor and improve both CPU and memory performance, as well as finding and ...

Get Mastering Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.