Description
Have you ever wondered how Python debugging looks on the inside? During this session, we’ll share how debugging actually works in Python. We’ll discuss the differences between CPython and PyPy interpreters, explain the underlying debugging mechanism and show you how to utilize this knowledge at work and up your watercooler talk game.
Abstract
The mainstream and off-the-beaten-track Python debuggers out there: pdb/bdb, PyDev Debugger - Eclipse/IntelliJ, IDLE, Atom, and others.
What is the underlying tech of Python debuggers?
1. Introduce the (hard to decipher) sys.settrace function and review its public documentation
2. Provide the missing documentation for sys.settrace and explain what it actually does.
3. Show a snippet of example code and explain how to handle multithreading when debugging
CPython Performance Benchmarks.
1. Review the performance optimizations we've done to maximize sys.settrace
2. Introduce the CPython Performance Benchmarks
3. Deep-dive into these benchmarks - why they matter
4. Discuss the alternatives of sys.set_trace
Quick intro to PyPy interpreter .
1. Share the performance benchmarks for PyPy
2. Discuss our insights (
What do you do once your debugger stopped?
1. Introduce the Python frame object and inspect module
2. Share example code
3. Discuss possible use cases