19 Debugging and Logging
Mistakes in code are inevitable. The bugs you’ll encounter can range from simple typos to malformed logic, from misunderstood usage to those strange errors that originate from deeper in the tech stack. As Lubarsky’s Law of Cybernetic Entomology observes, “There is always one more bug.” When things go horribly wrong in your code, you’re going to need the tools to find and fix the problem. In this chapter, you’ll learn all about those tools.
I’ll begin by covering three features of the Python language that you can add to your code to help you debug it later: warnings, logging, and assertions. These are improvements ...
Get Dead Simple 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.