In message <[EMAIL PROTECTED]>, Thomas Lotze wrote: > Suppose you have a function f which, as part of its protocol, raises some > standard exception E under certain, well-defined circumstances. Suppose > further that f calls other functions which may also raise E. How to best > distinguish whether an exception E raised by f has the meaning defined by > the protocol or just comes from details of the implementation?
You can't. All the information necessary to identify the exception must be in the exception object itself. If you want to distinguish between exceptions raised by F and those raised by other functions called by F, then they must be different exceptions. -- http://mail.python.org/mailman/listinfo/python-list