> The > question is: should the library function be able to just dump to > sys.exit() with a message about the error (like "couldn't open this > file"), or should the exception propagate to the calling program which > handles the issue? >
my view is that the exceptions are there precisely to tell the calling program about the error and give the programmer a chance to do something smart about it. A library, properly, doesn't even know the context in which it is running, and sys.exit() is pretty heavy handed for a library to call and shows assumptions beyond what a library should assume about its running environment. imho -- http://mail.python.org/mailman/listinfo/python-list