
March 26, 2022
7:29 p.m.
On Sat, Mar 26, 2022 at 05:49:41PM -0000, malmiteria wrote:
Also, Eventual hierarchy where the rule won't fit are simply not allowed today, no matter your use of super. take this one for example : ``` class A(X, Y): pass class B(Y, X): pass class C(A, B): pass ```
Because that is an inconsistent hierarchy, which makes the code broken, and leads to bugs. Both Python 1.x "classic classes" and Python 2.2 new-style classes allowed that, even though it is broken. However it is not *obviously* broken. Your classes need methods that actually do some work to see the breakage. See https://www.python.org/download/releases/2.3/mro/ for details. -- Steve