Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
2017 - Peter Hadlaw - Intro to pdb
Search
PyBay
August 13, 2017
Programming
0
150
2017 - Peter Hadlaw - Intro to pdb
PyBay
August 13, 2017
Tweet
Share
More Decks by PyBay
See All by PyBay
2017 - The Packaging Gradient
pybay
2
940
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
670
2017 - Bringing Python 3 to LinkedIn
pybay
1
570
2017 - Python Debugging with PUDB
pybay
0
720
2017 - Opening up to Open Source
pybay
0
260
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
200
2017 - Performant Asynchronous Programming at Quora
pybay
1
390
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
530
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
650
Other Decks in Programming
See All in Programming
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
AI Coding Agentのセキュリティリスク:PRの自己承認とメルカリの対策
s3h
0
230
Tool Catalog Agent for Bedrock AgentCore Gateway
licux
6
2.5k
2025 年のコーディングエージェントの現在地とエンジニアの仕事の変化について
azukiazusa1
24
12k
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
10
4.1k
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
130
Reading Rails 1.0 Source Code
okuramasafumi
0
220
CJK and Unicode From a PHP Committer
youkidearitai
PRO
0
110
Testing Trophyは叫ばない
toms74209200
0
880
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
240
Vue・React マルチプロダクト開発を支える Vite
andpad
0
110
私の後悔をAWS DMSで解決した話
hiramax
4
210
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
A Tale of Four Properties
chriscoyier
160
23k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.7k
The Invisible Side of Design
smashingmag
301
51k
Documentation Writing (for coders)
carmenintech
74
5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Optimizing for Happiness
mojombo
379
70k
Transcript
INTRO TO pdb Peter Hadlaw @ Tesorio August 13, 2017
https://www.tesorio.com/careers
TOO OFTEN I SEE... print foo print foo['bar'] print fizz.buzz()
...
CONS: Limited (can't interrupt execution) Messy (lot's of clean up)
Zero interactivity (need to modify code and run everything again) Much harder to dive deeper into third party code (internal or external alike)
DEBUGGER Exist in many languages and platforms Python's built-in debugger
is... "A computer program that assists in the detection and correction of errors in computer programs."
pdb
THREE EASY STEPS 1. Set a breakpoint 2. Run program
3. Execution halts at breakpoint and now, you, interact
SETTING A BREAKPOINT import pdb; pdb.set_trace() Using a one liner
is a nice habit to make clean up easier (e.g. a single dd in vi).
api.py
RUN PROGRAM
l - LIST COMMAND
EXPRESSIONS
n - NEXT COMMAND
s - STEP COMMAND
c - CONTINUE COMMAND
GENERAL FLOW Use l to orient yourself and inspect what
code is currently being executed. Use n to step forward in execution Use s to dive deeper Create expressions for the debugger to evaluate and gain insights into what's happening c to continue execution until next breakpoint / finish Profit.
NOTES More commands and features available iPython version, much more
powerful (has to be installed separately) Other languages have debuggers to, for example JavaScript in the browser, or C (gdb)
WE'RE HIRING https://www.tesorio.com/careers