News for hackers. Stuff that matters.
Re:What's New in Python 3.11? by int_19h on Monday June 27, 2022 @05:13AM (#31892208)
"Exception" is arguably a historical term in Python - it comes from languages where exceptions really are exceptional and very rarely handled; but when they're used for regular control flow, yeah, that's definitely a misnomer.

But our vocabulary is full of such things. A "method" is not a particularly descriptive term given what we use it for these days, either. At the end of the day, so long as everybody knows what it is, it's not a big deal.

Conceptually, though, it can be treated as an error monad.

Re:What's New in Python 3.11? by kortex on Monday June 27, 2022 @09:54AM (#31894622)
> Conceptually, though, it can be treated as an error monad.

Exceptions are very much not a monad, that's one of the biggest pain points about them. You can't map over exceptions. They are a control flow statement.

Re:What's New in Python 3.11? by int_19h on Monday June 27, 2022 @12:54PM (#31897305)
They're a monad with an implicit hardcoded mapping function that's basically equivalent to Rust's "try". Yes, the fact that you can't change the function is a pain, but it doesn't preclude reasoning about them in this manner.