Debugging & Profiling
pdb Debugger
Built-in Python debugger — interactive debugging with breakpoints, stepping, variable inspection, and post-mortem analysis.
Logging
The logging module for structured event tracking — log levels, handlers, formatters, filters, and production-ready logging configuration.
Profiling
Performance profiling with cProfile, pstats, and line_profiler — finding and fixing bottlenecks in Python code.
Memory Profiling
Tracking memory usage and finding leaks — tracemalloc, memory_profiler, objgraph, and sys.getsizeof for memory analysis.
timeit Module
Accurately measuring small code snippets — timeit for micro-benchmarks, comparing approaches, and understanding Python performance characteristics.
Traceback Analysis
Reading and understanding Python stack traces — traceback module, custom exception handling, and systematic error diagnosis.