Bug in New Style Classes

Michele Simionato michele.simionato at poste.it
Fri Jun 18 16:48:20 CEST 2004


Michael Hudson <mwh at python.net> wrote in message news:<m3d63xmb18.fsf at pc150.maths.bris.ac.uk>...
> Michele Simionato wrote:
> > Uhm, I can see that in certain cases it may work, both what if a
> > class has "object" as base and we change it to "type" ? What if we
> > change the base class from new style to old style? What if we change
> > one of the base classes with another one which is instance of a
> > different metaclass? How do you solve the conflicts? What about
> > ExtensionClasses and replacing normal bases with C-coded ones?
> 
> You get an exception.  Obviously.  Did you actually read what I said?

Actually that paragraph was not aimed to you. It was just to
clarify to the OP why there could be issues when changing __bases__.
What could be addressed to you is the question "why make your life
so difficult and force yourself to think to all possible things that
can go wrong when you could just make __bases__ read-only and be done
with it?" ;)
 
> > I see a recipe for disasters here, so that's why I thought the
> > developer removed the option of changing the bases.  That would be
> > understable. What I do not understand is why I cannot change the
> > __name__ of a function, what could possible go wrong with that??
> 
> Beats me too!  Maybe it's because you haven't written a patch yet :-)
> 
> Cheers,
> mwh

Touche' ;)



More information about the Python-list mailing list