Copy constructors

Guido van Rossum guido at python.org
Tue Aug 14 06:45:00 CEST 2001


[me]
> >All I want is to disable changes to *existing* classes by default.
> >You can write your own metaclass that changes the default, or you can
> >inherit from a dynamic base class -- thus, with very little effort,
> >you can make all your classes dynamic, if you want to.

[Roman]
> But not at run-time? Can I make
> 
> cls.__dynamic__ = 1
> 
> at runtime and then, for example, patch the classes of running
> system?

No.  If the class is immutable, you can't change its __dynamic__
attribute either, of course. :-)

> Or do I need to stop the system, make __dynamic__ changes and
> restart it again?

Yes.

--Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-list mailing list