Basically, the problem I have is asked here and there are some answers, like below, where Son
does some stuff like Father
(the init in this case) and some other stuff like GrandFather
(do_thing
).
class GrandFather(object):
def __init__(self):
pass
def do_thing(self):
# stuff
class Father(GrandFather):
def __init__(self):
super(Father, self).__init__()
def do_thing(self):
# stuff different than Grandfather stuff
class Son(Father):
def __init__(self):
super(Son, self).__init__()
def do_thing(self):
super(Father, self).do_thing() # <-- this line bypasses Father's implementation
What I am wondering is if there are any consequences to calling super
like that (the last line above), i.e., passing a class type other than your own.
I mean something like your code breaking at some weird point where you don't expect it.