On Fri, 23 Jul 2010 18:27:50 -0400, Terry Reedy wrote: > But in the > meanwhile, once you get an error, you know what it is. You can > intentionally feed code bad data and see what you get. And then maybe > add a test to make sure your code traps such errors.
That doesn't really help with exceptions which are triggered by external factors rather than explicit inputs. Also, if you're writing libraries (rather than self-contained programs), you have no control over the arguments. Coupled with the fact that duck typing is quite widely advocated in Python circles, you're stuck with the possibility that any method call on any argument can raise any exception. This is even true for calls to standard library functions or methods of standard classes if you're passing caller-supplied objects as arguments. -- http://mail.python.org/mailman/listinfo/python-list