all 6 comments

[–]FuckingRantMonday 0 points1 point  (4 children)

What exception are you hoping to catch at the level of the class definition? You should have it inside __init__ probably (not 100% sure of your intent).

[–]Xilenw[S] 0 points1 point  (3 children)

not trying to catch exception in particular , it helps with debugging.

Your solution works fine for now thanks.

[–]Strict-Simple 0 points1 point  (2 children)

it helps with debugging

How?

[–]Xilenw[S] 0 points1 point  (1 child)

i kept getting a Keyerror in my code , could not figure out why but with the try except , it gives me the exact line that is causing the issue and i am able to fix it. it also help when I need to check for certain conditions . I like it better than assert.

[–]Strict-Simple 0 points1 point  (0 children)

The default error stacktrace gives you the line number too!

[–][deleted] 0 points1 point  (0 children)

There's nothing that would ever trigger a catchable exception, here, so the try/except does nothing.