r/Python • • Jun 27 '26

Tutorial Handling Errors as Values in Python with Katharos

Hi guys this tutorial is about handling errors as value in Python or in nerd language monadic error handling pattern in Python using katharos library:

https://theblog.info/posts/handling-errors-as-values-in-python-with-katharos

30 Upvotes

9 comments sorted by

View all comments

14

u/Khavel_dev Jun 27 '26

Result types make sense where the language enforces them (Rust, Go). In Python you end up fighting the stdlib's exception model and wrapping every third-party call at the boundary. I keep trying this pattern and keep going back to try/except after a week.

1

u/max123246 Jun 27 '26

It's such a shame too. Python really feels like a great language right up to when you have to interface with anyone else's code. Argparse and Popen give me headaches with their documentation and flat "if nargs is ? then only then does const mean something" API surface