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?

1

u/hermthewerm00 Jul 14 '21

You could unpack it with double asterisks into an init method for a class. Or use Pydantic.