This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steven.daprano
Recipients docs@python, jdemeyer, maggyero, martin.panter, rhettinger, steven.daprano
Date 2019-06-09.01:06:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20190609010644.GP4221@ando.pearwood.info>
In-reply-to <1560028458.73.0.760090177142.issue37176@roundup.psfhosted.org>
Content
On Sat, Jun 08, 2019 at 09:14:18PM +0000, Raymond Hettinger wrote:

> Ideally, the text can also be made more compact.  Having eight 
> paragraphs sends an implicit message that this is too complex to 
> understand and that it should be avoided.

But it is complex -- as you point out, there are *at least* seven 
potential misapprehensions here.

super does a lot: there are at least four ways to call it (zero-argument 
form, unbound super, class+instance and class+subclass). And as the old 
"super considered harmful" versus "super considered super" debate shows, 
there are pitfalls in multiple inheritance that people run into.

The challenge here is that for 95% of cases (plucking a number from thin 
air) using super is simple: just follow the example in the docs. But the 
remaining troublesome cases can be very troublesome, and people running 
into those cases do need to understand the gory details.

> One essential goal is that we need to overcome strong preconceptions 
> about about what super() might do versus what it actually does.
[...]

Here's two more that you missed:

- that you should call super with super(type(self), self);

- that unbound super objects dispatch to unbound methods.

At some point or another over the last decade I've misunderstood super 
to do almost all of those things. As this thread shows, I thought I had 
understood it but I still misunderstood the role of the class calling 
super.
History
Date User Action Args
2019-06-09 01:06:51steven.dapranosetrecipients: + steven.daprano, rhettinger, docs@python, martin.panter, jdemeyer, maggyero
2019-06-09 01:06:51steven.dapranolinkissue37176 messages
2019-06-09 01:06:51steven.dapranocreate