[issue37176] super() docs don't say what super() does

Jeroen Demeyer report at bugs.python.org
Fri Jun 7 05:57:11 EDT 2019


Jeroen Demeyer <J.Demeyer at UGent.be> added the comment:

> Only one of the two arguments is called "type". The other is called 
"object-or-type".

I'm having problems with the first word of "a parent or sibling class of type". The most important part of super() is to *which* class that attribute lookups are delegated to and this is not explained.

> The __mro__ attribute is on the type, not the instance:

Sorry for that. I meant to say:

And the sentence "The __mro__ attribute of the type lists the method resolution search order used by both getattr() and super()" is even wrong or at least confusing: what matters is not the MRO of the type (the first argument to super()) but the MRO of ***the type of*** the object (the second argument to super()).

> Yes it is. Look at the example given:

An example is not an explanation. But it's true, this is the least of my problems with this doc.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37176>
_______________________________________


More information about the Python-bugs-list mailing list