Hi, I've started to learn Python and I'm a bit confused over how to call a method in a parent class. Assume I have:
class Parent(object): def somemethod( self, bla ): print 'Parent',bla I then create a child class that want to call somemethod. As I understand it I can either do it like this class Child(Parent): def somemethod( self, bla ): Parent.somemethod(self,bla) or like this class Child(Parent): def somemethod( self, bla ): super(Child,self).somemethod(bla) The first version seem to have the obvious disadvantage that I need to know the name of the parent class when I write the call, so I thought that the second version was the "proper" way of doing it. But when doing some research on the web it seem like the second version also have some problems. My question is simple: what is the "best" way of doing this and why? Or should I mix both these approaches? -- The Green Tea Leaf thegreenteal...@gmail.com thegreentealeaf.blogspot.com _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor