Changing ancestor classes at runtime

Chuck Esterbrook echuck at mindspring.com
Sun Mar 19 10:48:00 EST 2000


Hi,

If I have classes, A, B and C, where C inherits from B like so:

class A:
    pass

class C(B):
    pass


Is there a way, at runtime, to make C also inherit from A.  The key here is _at runtime_.

I didn't see anything obvious in dir(SomeClass) that lets me do something like class.__supers__.extend(otherClass).


-Chuck





More information about the Python-list mailing list