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
950
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
680
2017 - Bringing Python 3 to LinkedIn
pybay
1
570
2017 - Python Debugging with PUDB
pybay
0
740
2017 - Opening up to Open Source
pybay
0
270
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
210
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
660
Other Decks in Programming
See All in Programming
ネストしたdata classの面倒な更新にさようなら!Lensを作って理解するArrowのOpticsの世界
shiita0903
1
280
AI時代に必須!状況言語化スキル / ai-context-verbalization
minodriven
2
340
Blazing Fast UI Development with Compose Hot Reload (droidcon London 2025)
zsmb
0
480
SidekiqでAIに商品説明を生成させてみた
akinko_0915
0
120
テーブル定義書の構造化抽出して、生成AIでDWH分析を試してみた / devio2025tokyo
kasacchiful
0
400
予防に勝る防御なし(2025年版) - 堅牢なコードを導く様々な設計のヒント / Growing Reliable Code PHP Conference Fukuoka 2025
twada
PRO
30
8.8k
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
120
Eloquentを使ってどこまでコードの治安を保てるのか?を新人が考察してみた
itokoh0405
0
3k
Migration to Signals, Resource API, and NgRx Signal Store
manfredsteyer
PRO
0
150
퇴근 후 1억이 거래되는 서비스 만들기 | 내가 AI를 사용하는 방법
maryang
2
490
マイベストのシンプルなデータ基盤の話 - Googleスイートとのつき合い方 / mybest-simple-data-architecture-google-nized
snhryt
0
130
例外処理を理解して、設計段階からエラーを見つけやすく、起こりにくく #phpconfuk
kajitack
12
5.1k
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
A Tale of Four Properties
chriscoyier
161
23k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.7k
How STYLIGHT went responsive
nonsquared
100
5.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
54k
Thoughts on Productivity
jonyablonski
73
4.9k
Building Applications with DynamoDB
mza
96
6.7k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
How to Ace a Technical Interview
jacobian
280
24k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
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