Can anyone tell me how to bind to specific child class at run time in the following code? I want mCar instance in the following example redirect to class Truck or Compact according to command line options?
class Car(object):
pass
class Truck(Car):
pass
class Compact(Car):
pass
and a instance of Car
mCar = Car()
You mean like this?