Understanding and working with __metaclass__

Maxim Khesin max at cNvOiSsiPoAnMtech.com
Tue Dec 9 12:55:47 EST 2003


There is a nice example in from mailman by Eric Raymond:
http://pythonology.org/success&story=esr

David M. Wilson wrote:

> Hi there,
> 
> I've been sitting on the __metaclass__ feature for about 2 weeks now,
> and haven't really got that far with it. It looks like a very powerful
> tool, and I think I have even already identified places in my code
> where I could use it quite effectively, but I can't quite tell what it
> is /meant/ to be used for, or indeed what it is popularly used for.
> 
> Is there a page, posting, or other place I can turn to to get a
> developer's run-down on the practical uses of __metaclass__? The
> Python documentation states very clearly what it does, but I fear that
> journeying off on my own with it will lead to some terrible habit
> formation, and I already have enough of those to deal with. :)   (:set
> ts=3 ;)
> 
> Thanks for your time,
> 
> 
> David.





More information about the Python-list mailing list