Steve D'Aprano <steve+pyt...@pearwood.info> writes: > […] the result of passing a non-exception to raise is to raise an > exception, so I cannot trivially distinguish between "caller passes an > exception" and "caller passes a non-exception" (result is still an > exception).
Yes, hence my characterising this problem as the caller's problem. I'd say: document the expectation that the value will be an exception, use it based on that specification, and let the caller deal with the consequences of violating that expectation. -- \ “I went to court for a parking ticket; I pleaded insanity. I | `\ said ‘Your Honour, who in their right mind parks in the passing | _o__) lane?’” —Steven Wright | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list