Changing base class of a big hierarchy

John J. Lee jjl at
Mon Aug 4 00:44:52 CEST 2003

mis6 at (Michele Simionato) writes:
> Here is a hack that does the job (notice the word 'hack').
> Suppose you have a module called
> def modulesub(s,r,module):
[...code generation hack snipped...]
> import x
> Bsource=inspect.getsource(x.B)
> Bnewsource=inspect.getsource(B)
> x=modulesub(Bsource,Bnewsource,x) # redefine the module

I agree with you that it's a hack ;-).


More information about the Python-list mailing list