another question on metaclasses

Michele Simionato mis6 at pitt.edu
Tue Dec 10 17:55:42 EST 2002


Lulu wrote:

> But I still have to wonder about this, much as I do about most metaclass 
> examples, whether one really -needs- metaclasses to do this.  Of even if 
> there is anything clearer, easier to maintain, or any other advantage, about 
> this style.

I thought exactly this for some time, this is the reason why I never took
in consideration the metaclasses approach until now. I was quite skeptical 
about its advantages. But now I am reading "Putting Metaclasses to Work" and 
I have got the feeling that there is something more in metaclasses. 
The magic is somewhat in the fact that metaclasses can be inherited and used
in mixins as in the simple example I wrote. But still I haven't found a very 
compelling example for the use of metaclasses, nor I fully grasp the 
concept and its implications (yet). Nevertheless, my attitude is changing. 
Until yesterday I was very skeptical about Alex Martelli's claims on the 
power of metaclasses, today I have the impression that there is some meat in 
and not only the smoke. But still I haven't seen a compelling example 
in comp.lang.python (at least, one that I could understand ;-)


                               Michele



More information about the Python-list mailing list