[Zope] Metaclasses in ZOPE Products

Andreas Jung lists at andreas-jung.com
Sun Aug 7 13:13:15 EDT 2005



--On 7. August 2005 19:02:51 +0200 Jan-Ole Esleben <esleben at gmail.com> 
wrote:

> Hi!
>
> What do I need to do to derive a new base class for my products from
> item that defines its own meta class? There's a whole mess of code in
> the Zope source code that deals with meta classes, but nothing I can
> actually identify as the thing to do.
>
> I am deriving from SimpleItem at the moment. Currently, I use a meta
> class derived from type, but this doesn't work:
>
>   File "E:\Python23\lib\fliwas\ccitem.py", line 54, in ?
>     class CCItem(SimpleItem):
>   File "E:\Python23\lib\fliwas\ccmethods.py", line 38, in __new__
>     return type.__new__(cls, name, bases, classdict)
> TypeError: metaclass conflict: the metaclass of a derived class must be a
> (non-s trict) subclass of the metaclasses of all its bases
>

I don't know much about meta-classes but I think you require new-style 
classes for working with meta-classes. This implies that you need at least 
Zope 2.8 since new-style classes conflict with Zope ExtensionClasses in 
pre-Zope 2.8 versions.

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20050807/f0fc3d35/attachment.bin


More information about the Zope mailing list