~/talk

Debugging that bugger : Cleanly handling the errors

Talkat PyCon Italia 2023 · 2023-05-25..05-28· [testing, software-architecture]
links:none on file
slides:none on file

Explains how to read Python tracebacks, use try/except to catch specific errors, and when to raise your own exceptions; demonstrates why a bare except or catching Exception hides real bugs with concrete code samples. Shows using assert as a development-only sanity check that should fail fast and can be disabled, and demos the CLI debugger via pdb.set_trace() with stepping commands (n, s, p) so breakpoints and interactive inspection actually locate the failing line.

AI-written summary · about

  1. 0:00Introduction
  2. 0:34Traceback
  3. 4:45Raise Exception
  4. 11:45Assertions
  5. 14:12Things to keep in mind
  6. 16:11Python CLI debugger
  7. 17:13Setting breakpoint
  8. 18:32Stepping through your code
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.