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'm guessing that using a certain base class for my meta class should work, but the documentation doesn't say (as far as I can find out). TIA, Ole
--On 7. August 2005 19:02:51 +0200 Jan-Ole Esleben <esleben@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
participants (2)
-
Andreas Jung -
Jan-Ole Esleben