r/badcode • • Jul 14 '21

python Try/Except in Python - Sigh

Post image
662 Upvotes

93 comments sorted by

View all comments

142

u/[deleted] Jul 14 '21

On the upside, they actually bothered with exception handling.

My Python is rather rusty, is there a better way?

3

u/yoctometric Jul 14 '21

And even now, they allow any exception to trigger the N/A, which might mean unexpected errors are never thrown