[Tutor] super() vs. explicitly calling base class?

boB Stepp robertvstepp at gmail.com
Sat Sep 21 18:12:33 EDT 2019


Sigh.  Programming is so difficult in attempting to control the
complexity that may ensue!

On Sat, Sep 21, 2019 at 4:56 PM Richard Damon <Richard at damon-family.org> wrote:
>
> One other thing to note, even if you know who you are derived from, (or
> not derived from anyone), you should still use super if someone might
> derive from you, as that can change the proper initialization order (if
> ANYONE uses multiple inheritance).

I just finished reading the first of Mats' references, "Python's Super
is nifty, but you can't use it (Previously: Python's Super Considered
Harmful)" and am about halfway through the other one, "Python’s
super() considered super!".  Your point is well-taken as well as
Alan's warning!  In case one of our readers wishes to be spared
searching for the links to the articles Mats mentioned, they are:

https://fuhm.net/super-harmful/
https://rhettinger.wordpress.com/2011/05/26/super-considered-super/

As a "whining" (poor, poor pitiful me) side note, I can't even
remember which of n iterations I am currently in at having another go
at OOP, taking a long break, back at it again, break, wash and repeat
ad infinitum.  Anyway it seems I understand a bit more during each
wash and rinse cycle.  Perhaps some day... ~(:>))



-- 
boB


More information about the Tutor mailing list