[PEAK] Contextual / DecoratorTools.classy oddity

Sergey Schetinin maluke at gmail.com
Thu Jul 24 19:42:06 EDT 2008

Sorry to bother you but it's me again. Here's an odd error (also attached):

>>> from peak.context import Service
>>> from peak.util.decorators import classy
>>> class A(Service, classy): pass
>>> class B(A): pass
>>> class C(A): pass
>>> class D(B,C): pass
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\python25\lib\site-packages\DecoratorTools-1.7-py2.5.egg\peak\util\decorators.py",
line 625, in __new__
    cls = super(classy_class, meta).__new__(meta, name, bases, cdict)
TypeError: Error when calling the metaclass bases
    metaclass conflict: the metaclass of a derived class must be a
(non-strict) subclass of the metaclasses of all its bases

This seems to be exactly the thing classy is supposed to help avoid
and it's very strange to me that error happens when declaring D cause
there shouldn't be any MRO changes -- the subclasses are empty. The
actual case when I got this was trying to subclass both Service and

Best Regards,
Sergey Schetinin

http://s3bk.com/ -- S3 Backup
http://word-to-html.com/ -- Word to HTML Converter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: classy-repr.py
Type: text/x-python
Size: 157 bytes
Desc: not available
Url : http://www.eby-sarna.com/pipermail/peak/attachments/20080725/61181663/classy-repr.py

More information about the PEAK mailing list