Possible Duplicate:
Python dynamic inheritance: How to choose base class upon instance creation?
I want a class to choose a base class on the fly based on a parameter in the init method.
Class A():
#...
Class B():
#...
Class C():
def __init__(self, base_type):
if parent_type == 'A':
#TODO: make C derive A
else:
#TODO: make C derive B
A and B are library classes that derive the same base class.
The answers to a similar question seemed too ugly.