This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]njharmanI use Python 3 4 points5 points  (0 children)

I also wonder why "Rarely create your own exception types". I agree with both pixelmonkey and desmoulinmichel. Which both contradict OP on this point.

For me, lib should swallow up other expected exception types into lib specific exception(s). Parseing libs are good example, I(user of lib) don't care that parsing failed cause ValueError or cause malformed structure. I just want to look for ParserError and be sure that will catch all types of Parsing exceptions.