A class subclass of itself. Why mutual subclassing is forbidden?

后端 未结 6 675
天命终不由人
天命终不由人 2021-01-12 21:25

Complex question I assume, but studying OWL opened a new perspective to live, the universe and everything. I\'m going philosophical here.

I am trying to achieve a cl

6条回答
  •  梦谈多话
    2021-01-12 22:00

    The MRO scheme implemented in Python (as of 2.3) forbids cyclic subclassing. Valid MRO's are guaranteed to satisfy "local precedence" and "monotonicity". Cyclic subclassing would break monotonicity.

    This issue is discussed in the section entitled "Bad Method Resolution Orders"

提交回复
热议问题