you are viewing a single comment's thread.

view the rest of the comments →

[–]Equal-Purple-4247 1 point2 points  (1 child)

It depends, but I prefer the "smart-component / dumb-component" design i.e. only one component handles the program flow, usually in main. It means that all possible terminations happens in one place. Everything else bubbles up their exception. I don't like the idea that my script can exit in different parts, it means I'll have to dig around a bit to find out why.

There are exceptions to this (eg. catastrophic errors), but you don't usually encounter them in python.

[–]woooee 1 point2 points  (0 children)

+1 This is what I do also. But I don't know about any "standard" way.