When instantiating C calls B.__init__
, self.__class__
will still be C, so the super() call brings it back to B.
When calling super(), use the class names directly. So in B, call super(B, self)
, rather than super(self.__class__, self)
(and for good measure, use super(C, self)
in C). From Python 3, you can just use super() with no arguments to achieve the same thing
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…