this post was submitted on 15 Nov 2023
24 points (87.5% liked)

Python

6496 readers
1 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

πŸ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

🐍 Python project:
πŸ’“ Python Community:
✨ Python Ecosystem:
🌌 Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS
 

This is a discussion on Python's forums about adding something akin to a throws keyword in python.

you are viewing a single comment's thread
view the rest of the comments
[–] sugar_in_your_tea 3 points 1 year ago (1 children)

My point is that I don't like using exceptions for communicating regular errors, only unrecoverable faults. So adding features to document exceptions better just doesn't feel like the right direction.

Maybe that's un-Pythonic of me, idk. From the zen of Python:

Errors should never pass silently.
Unless explicitly silenced.

Using monads could let programmers silently pass errors.

I just really don't like the exception model after years of using other languages (mostly Rust and Go), I much prefer to be forced to contend with errors as they happen instead of just bubbling them up by default.