Python meta object question

Mickael Remond mikl at linux-france.org
Wed Dec 1 01:29:43 EST 1999


Mickael Remond wrote:
> 
> Hello,
> 
> Is there a way to automatically update the class tree to show the change
> in inherited class attributes after a class redefinition ?
> 

[...]

In fact, this example was an attempt at using meta programming features
of python.

In a Bytes Magazine article (1997) I read that :

     For a programming language, Python is flexible. Classes and method
     refer ences in Python are treated as first-class objects. That is,
     new methods and member variables can be added to a class at any
     time, and all existing and future instances of classes are affected
     by these changes. This way, a scheduled event on a server program
     can change a variable in the class definition that defines each
     user's privileges. Thus, when standard office hours end, access
     could be broadened automatically to certain users with a single
     line of code such as userClass.restrictions=3 . All existing and
     future instances of userClass are updated and use this new value
     until the class variable is changed again. A programmer maintaining
     the code for the server could log in and be allowed to add or
     update classes and methods without having to take the server down.
     
I did not find any clue on how to leverage these features. Are they out
of date ?

Mickael Remond




More information about the Python-list mailing list