Jeroen Demeyer <j.deme...@ugent.be> added the comment:

> What matters is the __mro__ attribute of the first argument. It matters 
because that is how the MRO actually is searched.

I'm sorry to say that you're wrong here. super() looks at the MRO of the type 
of the object (the second argument) (*). It has to do that in order to support 
diamonds. Consider a diamond like

  D
 / \
B   C
 \ /
  A

(with A as common base class). Now super(B, D()).attr will look in the MRO of D 
(which is D, B, C, A) and therefore delegate to C.attr. In this case, C does 
not even appear in the MRO of B.

(*) To be pedantic: in the special case that the second argument is a type 
itself, it looks at the MRO of the second argument.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37176>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to