Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:
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. ---------- _______________________________________ 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