On Sep 24, 12:56 pm, Stéphane Larouche <[EMAIL PROTECTED]> wrote: > What about something like: > > class A(object): > def my_method(self): > print "A.my_method" > def call_my_method(self): > if type(self).my_method == A.my_method: > print "Calling base class method." > else: > print "Calling derived class method." > self.my_method() > > class B(A): > pass > > class C(A): > def my_method(self): > print "C.my_method" > > a = A() > b = B() > c = C() > > a.call_my_method() > b.call_my_method() > c.call_my_method() > > Stéphane
I think it would confuse the user to have to call "call_my_method" as opposed to calling "my_method" directly. The only reason why I wanted to do this is simplicity, clarity and transparency. Thanks though. Bruno's solution does exactly what I was looking for. Ratko
-- http://mail.python.org/mailman/listinfo/python-list