CONSTRUCT - Adding Functionality to the Overall System

Ilias Lazaridis ilias at lazaridis.com
Tue Sep 19 10:14:37 EDT 2006


Ilias Lazaridis wrote:
> I understand that I can use __metaclass__ to create a class which
> modifies the behaviour of another class.
>
> How can I add this metaclass to *all* classes in the system?
>
> (In ruby I would alter the "Class" class)

I got confused from the discussion about __metaclass__.

possibly a little more practical.

I like to add a method "writeDebug(self, msg)" to all (or the most
possible) classes in the system.

How do I do this?

* with new style classes
* with old style classes
 
> .
> 
> http://lazaridis.com




More information about the Python-list mailing list