Contextual / DecoratorTools.classy oddity
"Sergey Schetinin" <[email protected]>
| Newsgroups | gmane.comp.python.peak |
|---|---|
| Message-ID | <[email protected]> |
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
Component.
--
Best Regards,
Sergey Schetinin
http://s3bk.com/ -- S3 Backup
http://word-to-html.com/ -- Word to HTML Converter
_______________________________________________
PEAK mailing list
[email protected]
http://www.eby-sarna.com/mailman/listinfo/peak
classy-repr.py
(text/x-python, 158 B)
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