Hooks, aspect-oriented programming, and design by contract

Alex Martelli aleax at aleax.it
Tue Jan 22 12:21:43 EST 2002


<gbreed at cix.compulink.co.uk> wrote in message
news:a2k6j1$3be$1 at thorium.cix.co.uk...
> Alex Martelli wrote:
>
> > I also point out that I don't know how to switch metaclasses
> > dynamically,
> > temporarily and "retroactively" (i.e. so that already-existing instances
    ...
> How retroactive do you want to be?  If you know in advance you might want
> to do this kind of thing, you can return a trivial subclass of the "real"
> class.  Then, to change all instances, reassign the __bases__.  It should

That's not compatible with changing the *metaclass*.  The same, it
appears to me, for the rest of your advice.  Maybe there is a way to
switch metaclasses dynamically and retroactively, but, if so, I still
don't know about it.


Alex






More information about the Python-list mailing list