Python super class reflection

前端 未结 4 1274
感动是毒
感动是毒 2021-02-03 21:30

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

4条回答
  •  忘掉有多难
    2021-02-03 21:53

    if you need to know to order in which super() would call the classes you can use C.__mro__ and don't need inspect therefore.

提交回复
热议问题