If I have Python code
class A(): pass class B(): pass class C(A, B): pass
and I have class C, is there a way to iterat
C
C.__bases__ is an array of the super classes, so you could implement your hypothetical function like so:
C.__bases__
def magicGetSuperClasses(cls): return cls.__bases__
But I imagine it would be easier to just reference cls.__bases__ directly in most cases.
cls.__bases__