3 ms·
Not just slightly shorter, because you need a handler for with MultiError.catch, which will be a function with and if and an instance check. Also, it doesn't g
by BiteCode_dev 5y ago
Not just slightly shorter, because you need a handler for with MultiError.catch, which will be a function with and if and an instance check.
Also, it doesn't give you easy "finally" and "else" clauses.
And "except *" calls the same handler for single and multi-errors, so for most cases, you avoid code duplication.
Plus, having a natural way to deal with this make the code easier to scan, not to forget IDE already have good support for a try/except, and wrapping things in it.
It's 100% a win.