overriding method that returns base class object

Stuart McGraw smcg4191 at frii.RemoveThisToReply.com
Mon Feb 16 17:28:44 EST 2004


I have a class A from a third party that I cannot change
and is implemented in C.  I derive my own class B from A 
and add a couple new methods and override a method.  The 
problem is that A has a method (call it A.f() ) that creates 
and returns a new A object.  I need B.f() to return a B 
object derived from A.f().  What is the best way to make 
that happen?




More information about the Python-list mailing list