I have a setup like below where B is an inner class and A is an outer class:
class A:
# some A stuff
class B:
# Some B stuff
If I have a B instance:
b = B()
How can I get class A?
In other words, I want something like type(b) which normally gives class B but instead to get b's outer class A.
Edit
I have found __qualname__ with which if you do type(b). __qualname__ you get the string "A.B". Although close, I don't think from the string I can get the outer class itself.