Copy constructors

Roman Suzi rnd at onego.ru
Tue Aug 14 00:31:44 EDT 2001


On Tue, 14 Aug 2001, Guido van Rossum wrote:

>jasbahr at onebox.com (Jason Asbahr) writes:
>
>> I agree with the general opinion here that having virtual
>> as default feels like the more 'Pythonic' solution.
>
>There must be a misunderstanding.  Alex used C++ virtual functions as
>an example where C++ went wrong, as an argument for why dynamicism
>should be the default.  In Python, all functions are virtual: you can
>always override them in a subclass, and I am not going to change this!
>
>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.

But not at run-time? Can I make

cls.__dynamic__ = 1

at runtime and then, for example, patch the classes of running system? Or
do I need to stop the system, make __dynamic__ changes and restart it
again?

>If it turns out that this is not sufficient for a wide range of
>applications, I'll reconsider the default; but I'd rather not, because
>there is a severe run-time penalty for the generally unneeded
>dynamicism.

Sincerely yours, Roman Suzi
-- 
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd at onego.ru _/
_/ Monday, August 13, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "I distinctly remember forgetting that." _/





More information about the Python-list mailing list