python: how to get the class of a calling method through inspection?
<p>For my exception class I'd like to find out whether the function which instantiated the exception object is a method and if so, show the class name.</p>

<p>So in the <strong>init</strong> method of my exception class I get the name of the calling function:</p>

<pre><code>frame, module, line, function, context, index = inspect.stack()[1]
</code></pre>

<p>But is there any way the get the class name (if any) of the calling function?</p>
