Hi there,<br><br>I have a couple of interfaces sharing a common base that my annotation adapters will implement:<br><br>&gt;&gt;&gt; from zope.interface import Interface<br>&gt;&gt;&gt; class IBaseAnnotation(Interface):<br>
...     pass<br>...<br>&gt;&gt;&gt; class IAnnotationA(IBaseAnnotation):<br>...     pass<br>... <br>&gt;&gt;&gt; class IAnnotationB(IBaseAnnotation):<br>...     pass<br>... <br><br>Along with a content class:<br><br>&gt;&gt;&gt; class Content(object):<br>
...     pass<br>... <br><br>And finally some actual adapters:<br><br>&gt;&gt;&gt; import grok<br>&gt;&gt;&gt; class AnnotationA(grok.Annotation):<br>...     grok.implements(IAnnotationA)<br>...     grok.context(Content)<br>
... <br>&gt;&gt;&gt; class AnnotationB(grok.Annotation):<br>...     grok.implements(IAnnotationB)<br>...     grok.context(Content)<br>... <br><br>Imagine that the above has been grokked. <br><br>Let&#39;s get a Content object:<br>
<br>&gt;&gt;&gt; content = Content()<br><br>And give it one annotation from the two adapters I&#39;ve defined:<br><br>&gt;&gt;&gt; meta_a = IAnnotationA(content)<br>&gt;&gt;&gt; meta_a.foo = &quot;MEGROK!!!&quot;<br><br>Something strange now happens when I try to get all adapters to my base annotation interface from the component architecture:<br>
<br>&gt;&gt;&gt; from zope.component import getAdapters<br>&gt;&gt;&gt; list(getAdapters((content,), IBaseAnnotation)<br>      [(u&#39;&#39;, &lt;....AnnotationB object at 0x8ff5f6c&gt;)]<br><br>It&#39;s given me the wrong object back! If I rerun the above but _omit_ the definition of ``AnnotationB`` then it gives me the correct result of ``AnnotationA``. <br>
<br>After some digging, I found that using:<br><br>&gt;&gt;&gt; from zope.annotations.interfaces import IAnnotations<br>&gt;&gt;&gt; list(getAdapters((content,), IAnnotations)<br><br>gives correct results in both cases - but for my particular example it also gives a:<br>
``zope.dublincore.annotatableadapter.ZDCAnnotationData`` too (for container items only) which I don&#39;t want. I could filter this out of course without much problem - but something doesn&#39;t smell right!! <br><br>Any hints/advice would be welcomed!<br>
<br>Regards,<br>Paul<br>