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.
To recap, in this chapter, we talked about non-interactive debugging with print
statements, logging
, trace
, traceback
, asyncio
, and faulthandler
. We also explored interactive debugging with the Python debugger, IPython, and Jupyter, as well as learning about alternative debuggers.
In the next chapter, we will see how to monitor and improve both CPU and memory performance, as well as finding and fixing memory leaks.
Join our community on Discord
Join our community’s Discord space for discussions with...