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
160
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
1k
2017 - Building Bridges: Stopping Python 2 without damages
pybay
0
710
2017 - Bringing Python 3 to LinkedIn
pybay
1
600
2017 - Python Debugging with PUDB
pybay
0
780
2017 - Opening up to Open Source
pybay
0
280
2017 - A Gentle Introduction to Text Classification with Deep Learning
pybay
2
220
2017 - Performant Asynchronous Programming at Quora
pybay
1
400
2017 - latus - a Personal Cloud Storage App written in Python
pybay
2
570
2017 - Everything You Ever Wanted to Know About Web Authentication in Python
pybay
3
720
Other Decks in Programming
See All in Programming
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
190
How to stabilize UI tests using XCTest
akkeylab
0
130
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
230
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
270
生成 AI 時代のスナップショットテストってやつを見せてあげますよ(α版)
ojun9
0
250
CDIの誤解しがちな仕様とその対処TIPS
futokiyo
0
220
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
170
オブザーバビリティ駆動開発って実際どうなの?
yohfee
4
870
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
240
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
5
1k
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
520
ベクトル検索のフィルタを用いた機械学習モデルとの統合 / python-meetup-fukuoka-06-vector-attr
monochromegane
2
470
Featured
See All Featured
The Mindset for Success: Future Career Progression
greggifford
PRO
0
280
WENDY [Excerpt]
tessaabrams
9
36k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.3k
How to Think Like a Performance Engineer
csswizardry
28
2.5k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
92
Chasing Engaging Ingredients in Design
codingconduct
0
140
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
120
Discover your Explorer Soul
emna__ayadi
2
1.1k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
150
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.7k
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