~/talk

Beyond Try-Except: The Frontier of Python Error Handling with Monads and Railway Magic

TalkinSpanishat PyCon US 2025 · 2025-05-16..05-18· [python]
links:none on file
slides:none on file

Presents replacing try/except with a Result monad and Railway-oriented flow to make error handling predictable and more readable. Shows concrete Python code using the Results Library that returns Ok/Error for a validation → calculation → charge pipeline, plus file-read and DB-connection examples; demonstrates a decorator to wrap functions without massive refactors and uses pattern matching to separate success and failure paths, with a how-to for chaining operations and capturing errors without scattered exceptions.

AI-written summary · about

  1. 0:00Introduction
  2. 1:06Talk objectives
  3. 3:13Traditional Python error handling
  4. 8:47Limitations of traditional approaches
  5. 10:52Introduction to monads
  6. 15:25Railway Driven Development
  7. 16:27Traditional code example
  8. 21:22Monads and Railway Magic solution
  9. 24:51Pattern matching for errors
  10. 27:40Decorators and complex cases
  11. 29:04Key benefits
  12. 30:07Q&A
~/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.