[Python-Dev] assigning to new-style-class.__name__

Michael Hudson mwh@python.net
27 Nov 2002 13:20:02 +0000

Michael Hudson <mwh@python.net> writes:

> "Samuele Pedroni" <pedronis@bluewin.ch> writes:
> > I haven't looked at the code, but if it checks directly for the consistency of
> > E's mro when you change C's bases, then there is no way to move from a
> > hierarchy where A precedes B in the mros to one where the two are swapped,

Yes there is!  With A thru E as in my previous mail:

C.__bases__ = (A,)

D.__bases__ = (B, A)

C.__bases__ = (B, A)

Now there are situations where this can probably cause difficulties,
but that's always going to be possible...

> Do you (or anyone else) know what CL or Dylan or other dynamic MI
> languages do about this?

It doesn't seem CL (even with the MOP) allows dynamic rearrangement of
bases.  So I can't nick their ideas :-/


  Famous remarks are very seldom quoted correctly.
                                                    -- Simeon Strunsky