creating many similar properties

Michele Simionato michele.simionato at gmail.com
Wed Oct 18 10:18:09 CEST 2006


George Sakkis wrote:
>
> Why is this less hidden or magical than a metaclass ?

Because it does not use inheritance. It is not going to create
properties on subclasses without
you noticing it. Also, metaclasses are brittle: try to use them with
__slots__, or with non-standard
classes (i.e. extensions classes), or try to use multiple metaclasses.
I wrote a paper
about metaclasses abuses which should be published soon or later; you
can see the draft
here:
http://www.phyast.pitt.edu/~micheles/python/classinitializer.html

    Michele Simionato




More information about the Python-list mailing list