slots , setattr, metaclass

Michele Simionato michele.simionato at poste.it
Mon Jan 12 10:41:19 EST 2004


"Roman Yakovenko" <roman.yakovenko at actimize.com> wrote in message news:<mailman.287.1073894630.12720.python-list at python.org>...
> Hi. I have small problem and I don't know solution.
> The problem: every class imported from some module X should not allow to 
> be modified
> ( modified == adding or deleting new class attributes ). 

I think you may be interested in this recipe:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252158

(uses setattr, metaclasses, no slots).


    Michele



More information about the Python-list mailing list