Re: How do I say two classes up in the inheritance chain in python?

2009-01-27 Thread Duncan Booth
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

Re: How do I say two classes up in the inheritance chain in python?

2009-01-27 Thread Ben Finney
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

Re: How do I say two classes up in the inheritance chain in python?

2009-01-27 Thread Bruno Desthuilliers
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

Re: How do I say two classes up in the inheritance chain in python?

2009-01-27 Thread Daniel Fetchinson
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 ): #

How do I say two classes up in the inheritance chain in python?

2009-01-26 Thread Daniel Fetchinson
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