I have python code like this.
File named mymodule.py
class MyBase(object): pass
File named data.py
from mymodule import MyBase class A: class NestA(MyBase): pass class NestB(MyBase): pass class B: class NestA(MyBase): pass class NestB(MyBase): pass
if I have a = A.NestA (it does not belong to the class, a is not an object of the NestA class, but the class itself), how can I find out which nested class hierarchy it belongs to? a. name gives me NestA, so this is not a problem. I want to know which external NestA class is part, that is, class A or class B. How do I do this?
source share