Daniel Fetchinson fetchin...@googlemail.com wrote:
class child1( parent1 ):
def meth( self ):
# do something c
super( parent1, self ).meth( ) # I want to invoke meth on
grandparent
So just call:
grandparent.meth(self)
If you want to ignore the
Daniel Fetchinson fetchin...@googlemail.com writes:
The meth methods in child1 and child2 are the same, except that in
the last super call, one is referring to parent1, the other is
referring to parent2.
It's important to learn that, in a language with multiple inheritance,
“superclass of
Daniel Fetchinson a écrit :
I have two classes that both inherit from two other classes which both
inherit from a single class. The two children have two almost
identical methods:
class grandparent( object ):
def meth( self ):
# do something
class parent1( grandparent ):
def
I have two classes that both inherit from two other classes which both
inherit from a single class. The two children have two almost
identical methods:
class grandparent( object ):
def meth( self ):
# do something
class parent1( grandparent ):
def meth( self ):
#
I have two classes that both inherit from two other classes which both
inherit from a single class. The two children have two almost
identical methods:
class grandparent( object ):
def meth( self ):
# do something
class parent1( grandparent ):
def meth( self ):
# do