The Hidden Power of the Python Runtime
summary
Explains how to read the actual runtime facts: use sys._getframe and code objects to get names and file/line, read values from frame.f_locals and traceback objects, and attach tracing via sys.settrace or sys.setprofile to collect events. Shows concrete tools that use this — debuggers, line-coverage collectors like coverage.py, and runtime type collectors — and demos a simple deadlock tracer using threading.current_frames that prints real stacks and actually finds stuck threads.
AI-written summary · about
chapters (36)
- 0:00Intro
- 1:03Test Frameworks
- 1:21Assertion Error
- 2:42Created Explicitly
- 2:58Python Objects
- 4:30Python Power
- 5:08Python Stack Frame
- 5:47Frame Object: Variables
- 6:44Code Object
- 8:21Previous Frame
- 9:41Contents
- 10:36Exception Object
- 10:55AssertionError Variables
- 11:56Usage
- 13:13Python Debugger
- 13:53Frame Evaluation
- 14:13More About Debuggers
- 14:26Access to Frame
- 14:42Debugger: Location
- 14:53Debugger: Variables
- 15:36Code Coverage
- 15:51coverage.py
- 16:53Typing Tools
- 17:56Acces To Frame
- 18:40Collecting Types
- 19:59Concurrent Execution
- 20:16Synchronisation
- 20:49Deadlock
- 22:08Thread States
- 22:33Thread Handler
- 23:23Async Locks
- 23:43Async Fault Handler
- 24:42Development Tools
- 25:17The Hidden Power of Runtime
- 25:35Inspiration
- 26:01Links
related talks
28mWhat makes a Python debugger possible and how can we make it 100x faster
22mLow Level Python a Deep dive into the python sources
23mTrace functions: Building a tiny debugger
38mBecause You Can Run, You Can't Hide: Some Musings on API Design
24mLet’s Rethink Debugging
28mKnocking On A Process’s Door: Introspecting Live Python Processes
01h 03mA tour of CPython's runtime
50mHow I built a power debugger out of the standard library and things I found on the internet
