How to find out the nested class hierarchy?
<p>I have a python code like this.</p>

<p>File named mymodule.py</p>

<pre><code>class MyBase(object):
    pass
</code></pre>

<p>File named data.py</p>

<pre><code>from mymodule import MyBase

class A:
    class NestA(MyBase):
        pass
    class NestB(MyBase):
        pass

class B:
    class NestA(MyBase):
        pass
    class NestB(MyBase):
        pass
</code></pre>

<p>if I have a = A.NestA (not it is referring to a class, a is not the object of class NestA but the class itself) how do I find out what nested class hierarchy does a belong to? a.<strong>name</strong> gives me NestA so that is not a problem. I want to find out what outer class NestA is part of, i.e class A or class B. How do I do it?</p>
