Python exceptions considered an anti-pattern
And every step might fail with the exception, so we have wrapped all methods into the wrapper:
First of all, you can not unwrap any values while writing your own business logic:
And this will work without any problems. That’s how our result code will look like in the end:
This is a perfectly readable and safe way to do the exact same thing as we previously did with the unsafe function. It eliminates all the problems we had with exceptions:
Obviously, you can not write all your code this way.
Source: sobolevn.me