Debugging Python
Contents:
Introduction
Python features relevant for debugging
Defensive Programming
The Python Debugger
Exercises
Debugging Python
»
Debugging Python
View page source
Debugging Python
Contents:
Introduction
The four steps of debugging
Debugging is the art of identifying inconsistency between the expected and actual operation
Ommitted topics, but that could have been covered:
Python features relevant for debugging
Python is an interpreted language
Datatypes – strongly and dynamically typed
Scoping
Mutable vs immutable datatypes
Functions can have default arguments
Memory management
Dependency issues
Virtual environments
Working with packaged python code
Error Messages
Defensive Programming
Reporting (un)expected state
Checks while writing
Divide and conquer
Document well
The Python Debugger
Watching variables
Pdb in various environments
pdb with iPython: ipdb
pdb with jupyter
pdb with spyder
Alternatives for pdb
Exercises
Ex 0. Try debugging divide_by_zero.py
Ex 1. Install double pendulum
Ex 2. Fix the broken pendulum
Ex 3. Defend!
Index
Module Index
Search Page