listing exceptions programmatically - Python
<p>Is there any way to programmatically determine which exceptions an object or method might raise?</p>

<p>Like <code>dir(obj)</code> lists available methods, I'm looking for the equivalent <code>dir_exceptions(obj)</code>.</p>

<p>As far as I know, the only way to achieve this would be to parse the source.</p>
